Fixed showing orders with not required termination
This commit is contained in:
@@ -256,8 +256,20 @@ class OrderModel {
|
||||
|
||||
if(array_key_exists("product_id", $filter)) {
|
||||
$product_id = $filter['product_id'];
|
||||
if(is_numeric($product_id)) {
|
||||
$where .= " AND OrderProduct.product_id=$product_id";
|
||||
if($product_id) {
|
||||
if(in_array(substr($filter['product_id'], 0, 2), ["<=", ">="])) {
|
||||
$op = substr($filter['product_id'], 0, 2);
|
||||
$product_id = substr($filter['product_id'], 2);
|
||||
} elseif(in_array(substr($filter['product_id'], 0, 1), ["<", ">"])) {
|
||||
$op = substr($filter['product_id'], 0, 1);
|
||||
$product_id = substr($filter['product_id'], 1);
|
||||
} else {
|
||||
$op = "=";
|
||||
$product_id = $filter['product_id'];
|
||||
}
|
||||
if(is_numeric($product_id)) {
|
||||
$where .= " AND OrderProduct.product_id $op $product_id";
|
||||
}
|
||||
} elseif($product_id === null) {
|
||||
$where .= " AND OrderProduct.product_id IS NULL";
|
||||
}
|
||||
@@ -313,7 +325,7 @@ class OrderModel {
|
||||
$where .= " AND Building.street LIKE '%$street%'";
|
||||
}
|
||||
}
|
||||
var_dump($filter['building_status_code']);
|
||||
//var_dump($filter['building_status_code']);
|
||||
if(array_key_exists("building_status_code", $filter)) {
|
||||
if(in_array(substr($filter['building_status_code'], 0, 2), ["<=", ">="])) {
|
||||
$op = substr($filter['building_status_code'], 0, 2);
|
||||
|
||||
Reference in New Issue
Block a user