Added residential/business filter in Order
This commit is contained in:
@@ -118,6 +118,14 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="filter_customer_type">Kundentyp</label>
|
||||
<select name="filter[customer_type]" id="filter_customer_type" class="form-control">
|
||||
<option></option>
|
||||
<option value="residential" <?=($filter['customer_type'] == "residential") ? 'selected="selected"' : ""?>>Residential</option>
|
||||
<option value="business" <?=($filter['customer_type'] == "business") ? 'selected="selected"' : ""?>>Business</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="row mt-2">
|
||||
|
||||
@@ -123,7 +123,7 @@ class OrderController extends mfBaseController {
|
||||
//}
|
||||
|
||||
$showLoneliesCount = false;
|
||||
foreach(["owner", "owner_address", "partner_number", "finish_date"] as $key) {
|
||||
foreach(["owner", "owner_address", "partner_number"] as $key) {
|
||||
if(array_key_exists($key, $filter) && $filter[$key]) {
|
||||
$showLoneliesCount = true;
|
||||
break;
|
||||
|
||||
@@ -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