浏览代码

餐品加供应商

gorden 9 月之前
父节点
当前提交
99147deca2
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. 8 4
      app/admin/service/goods/GoodsService.php

+ 8 - 4
app/admin/service/goods/GoodsService.php

@@ -232,10 +232,14 @@ class GoodsService
                 $query->where('goods_classify', $classify);
             }
         })->when( !empty($type),function ($query) use ($type){
-                if ($type == 'storageWarning'){
-                    $query->where('goods_running.goods_running_storage','<=',2);
-                }
-            })
+            if ($type == 'storageWarning'){
+                $query->where('goods_running.goods_running_storage','<=',2);
+            }
+        })->when(!empty($goodsSupplierId),function($query) use ($goodsSupplierId){
+            $query->where('join_goods_supplier_id', $goodsSupplierId);
+        })->when(!empty($goodsStatus),function($query) use ($goodsStatus){
+            $query->where('goods_status', $goodsStatus);
+        })
             ->count();
 
         foreach ($rows as &$row) {