Added residential/business filter in Order
This commit is contained in:
@@ -162,6 +162,7 @@ class OrderModel {
|
||||
LEFT JOIN Address ON (Address.id = `Order`.owner_id)
|
||||
LEFT JOIN OrderProduct ON (OrderProduct.order_id = `Order`.id)
|
||||
LEFT JOIN Product ON (Product.id = OrderProduct.product_id)
|
||||
LEFT JOIN Producttech ON (Producttech.id = Product.producttech_id)
|
||||
LEFT JOIN Termination ON (Termination.id = OrderProduct.termination_id)
|
||||
LEFT JOIN Building ON (Building.id = Termination.building_id)
|
||||
LEFT JOIN Terminationstatus ON (Terminationstatus.id = Termination.status_id)
|
||||
@@ -193,6 +194,7 @@ class OrderModel {
|
||||
LEFT JOIN Address ON (Address.id = `Order`.owner_id)
|
||||
LEFT JOIN OrderProduct ON (OrderProduct.order_id = `Order`.id)
|
||||
LEFT JOIN Product ON (Product.id = OrderProduct.product_id)
|
||||
LEFT JOIN Producttech ON (Producttech.id = Product.producttech_id)
|
||||
LEFT JOIN Termination ON (Termination.id = OrderProduct.termination_id)
|
||||
LEFT JOIN Building ON (Building.id = Termination.building_id)
|
||||
LEFT JOIN Terminationstatus ON (Terminationstatus.id = Termination.status_id)
|
||||
@@ -332,6 +334,23 @@ class OrderModel {
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("producttech_id", $filter)) {
|
||||
$producttech_id = $filter['producttech_id'];
|
||||
if(is_numeric($producttech_id)) {
|
||||
$where .= " AND Product.producttech_id=$producttech_id";
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists("customer_type", $filter)) {
|
||||
if($filter['customer_type'] === "business") {
|
||||
$where .= " AND Producttech.customer_type='business'";
|
||||
}
|
||||
if($filter['customer_type'] === "residential") {
|
||||
$where .= " AND Producttech.customer_type='residential'";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(array_key_exists("building_id", $filter)) {
|
||||
$building_id = $filter['building_id'];
|
||||
if(is_numeric($building_id)) {
|
||||
|
||||
Reference in New Issue
Block a user