Fixed showing orders with not required termination
This commit is contained in:
@@ -101,8 +101,8 @@ class OrderController extends mfBaseController {
|
||||
|
||||
$lonelyOrders = [];
|
||||
unset($order_search["network_id"]);
|
||||
//$order_search['product_id'] = null;
|
||||
// all orders without a product or with products without terminations
|
||||
$order_search['product_id'] = null;
|
||||
// orders without a product
|
||||
if($this->me->isAdmin()) {
|
||||
$lonelies = OrderModel::search($order_search);
|
||||
} else {
|
||||
@@ -114,7 +114,31 @@ class OrderController extends mfBaseController {
|
||||
$lonelyOrders[$order->id] = $order;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// orders with termination product not requiring termination_id
|
||||
$order_search['product_id'] = ">0";
|
||||
$order_search['termination_id'] = null;
|
||||
if($this->me->isAdmin()) {
|
||||
$lonelies = OrderModel::search($order_search);
|
||||
} else {
|
||||
$order_search['create_by'] = $this->me->id;
|
||||
$lonelies = OrderModel::search($order_search);
|
||||
}
|
||||
foreach($lonelies as $order) {
|
||||
if(!array_key_exists($order->id, $orders)) {
|
||||
$o = new Order($order->id);
|
||||
foreach($o->products as $p) {
|
||||
//var_dump($p->product->attributes);exit;
|
||||
if(array_key_exists(TT_ATTRIB_TERMINATION_REQUIRED_NAME, $p->product->attributes)) {
|
||||
$this->log->debug("found additional order wher termination_required 0");
|
||||
$lonelyOrders[$order->id] = $order;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//$lonelyOrders[$order->id] = $order;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->layout()->set("orders", $orders);
|
||||
|
||||
Reference in New Issue
Block a user