Fixed showing orders with not required termination
This commit is contained in:
@@ -128,9 +128,11 @@ class OrderController extends mfBaseController {
|
||||
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");
|
||||
$attribs = $p->product->attributes;
|
||||
if(is_array($attribs) && count($attribs)
|
||||
&& array_key_exists(TT_ATTRIB_TERMINATION_REQUIRED_NAME, $attribs)
|
||||
&& $$attribs[TT_ATTRIB_TERMINATION_REQUIRED_NAME]->value == 0) {
|
||||
$this->log->debug("found additional order where termination_required 0");
|
||||
$lonelyOrders[$order->id] = $order;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -286,6 +286,8 @@ class OrderModel {
|
||||
$termination_id = $filter['termination_id'];
|
||||
if(is_numeric($termination_id)) {
|
||||
$where .= " AND OrderProduct.termination_id=$termination_id";
|
||||
} elseif($termination_id === null) {
|
||||
$where .= " AND OrderProduct.termination_id IS NULL";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user