shish 3 лет назад
Родитель
Сommit
ce6d3afdce

+ 4 - 1
app-ghs/controllers/GhsController.php

@@ -122,7 +122,10 @@ class GhsController extends BaseController
                 $where['name'] = ['like', $name];
             }
         }
-
+        $location = $get['location'] ?? '';
+        if (is_numeric($location)) {
+            $where['location'] = $location;
+        }
         $list = GhsClass::getGhsList($where);
         util::success($list);
     }

+ 7 - 4
app-ghs/controllers/PurchaseOrderController.php

@@ -51,7 +51,7 @@ class PurchaseOrderController extends BaseController
             $bigUnit = $item->bigUnit ?? '';
             $ratio = $item->ratio ?? 0;
             $unit = $ratio . $smallUnit . '/' . $bigUnit;
-            if(isset($item->ratioType) && $item->ratioType == 1){
+            if (isset($item->ratioType) && $item->ratioType == 1) {
                 $unit = '若干' . $smallUnit . '/' . $bigUnit;
             }
 
@@ -297,8 +297,9 @@ class PurchaseOrderController extends BaseController
                 }
             }
         }
-
+        $where = [];
         $get = Yii::$app->request->get();
+        $where['shopId'] = $this->shopId;
         $orderStatus = $get['status'] ?? '';
         if ($orderStatus) {
             $where['status'] = $orderStatus;
@@ -307,8 +308,10 @@ class PurchaseOrderController extends BaseController
         if (!empty($ghsId)) {
             $where['ghsId'] = $ghsId;
         }
-        $where['sjId'] = $this->sjId;
-        $where['shopId'] = $this->shopId;
+        $location = $get['location'] ?? '';
+        if (is_numeric($location)) {
+            $where['location'] = $location;
+        }
         $data = PurchaseOrderClass::getOrderList($where);
         //状态统计,很慢,暂时隐藏
         //$statData = PurchaseOrderClass::statNum($this->shopId);