No also showing orders without termination

This commit is contained in:
Frank Schubert
2021-10-12 19:39:12 +02:00
parent 7237f372dc
commit 6d41583735
3 changed files with 16 additions and 15 deletions

View File

@@ -97,7 +97,7 @@
<div class="card">
<div class="card-body mb-3">
<div class="float-left">
<h4 class="header-title">Bestellungen ohne Produkt</h4>
<h4 class="header-title">Bestellungen ohne Anschluss</h4>
</div>
<table class="table table-striped table-hover">

View File

@@ -100,21 +100,22 @@ class OrderController extends mfBaseController {
$lonelyOrders = [];
//if(!count($filter)) {
unset($order_search["network_id"]);
$order_search['product_id'] = null;
if($this->me->isAdmin()) {
$lonelies = OrderModel::search($order_search);
} else {
$order_search['create_by'] = $this->me->id;
$lonelies = OrderModel::search($order_search);
//$order_search['product_id'] = null;
// all orders without a product or with products without terminations
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)) {
$lonelyOrders[$order->id] = $order;
}
foreach($lonelies as $order) {
if(!array_key_exists($order->id, $orders)) {
$lonelyOrders[$order->id] = $order;
}
}
//}
}
$this->layout()->set("orders", $orders);
$this->layout()->set("lonelyOrders", $lonelyOrders);

View File

@@ -199,7 +199,7 @@ class OrderModel {
GROUP BY `Order`.id
ORDER BY `Order`.order_date ASC";
//mfLoghandler::singleton()->debug($sql);
mfLoghandler::singleton()->debug($sql);
if(is_array($limit) && count($limit)) {
if(is_numeric($limit['start']) && is_numeric($limit['count'])) {