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

+ 1 - 1
app-ghs/controllers/ConsoleController.php

@@ -157,7 +157,7 @@ class ConsoleController extends BaseController
             ["name" => "结账记录", "img" => "ghs/home/kcyjs.png", "url" => "/admin/clear/customList"],
             ["name" => "支出", "img" => "ghs/home/kcyjs.png", "url" => "/admin/expend/list"],
             ["name" => "盘点", "img" => "ghs/home/pandian.png", "url" => "/pagesStorehouse/inventory/list"],
-            ["name" => "库存预警", "img" => "ghs/home/kcyjs.png", "url" => "/pagesStorehouse/stockWarn/manage"],
+            ["name" => "库存预警", "img" => "ghs/home/kcyjs.png", "url" => "/admin/item/list?warning=1"],
         ];
 
         util::success(['asset' => $this->main, 'notice' => $notice,

+ 2 - 6
app-ghs/controllers/ProductController.php

@@ -143,14 +143,10 @@ class ProductController extends BaseController
 
         if ($warning == 1) {
             //库存预警
-//            $sql = "SELECT * FROM `" . Product::tableName() . "` WHERE mainId={$this->mainId} and delStatus=0 and stock<stockWarning";
-//            $command = Yii::$app->db->createCommand($sql);
-//            $itemInfoData = $command->queryAll();
-
-            $itemInfoData = Product::find()->where("mainId={$this->mainId}")->andWhere('`stock`<`stockWarning`')
+            $itemInfoData = Product::find()->where("mainId={$this->mainId}")
+                ->andWhere('`stock`<`stockWarning`')
                 ->andWhere("delStatus=0")
                 ->select('*')->asArray()->all();
-
         } else {
             $itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], "*");
         }