shish hace 3 años
padre
commit
3eef1699fd
Se han modificado 1 ficheros con 10 adiciones y 5 borrados
  1. 10 5
      app-ghs/controllers/ProductController.php

+ 10 - 5
app-ghs/controllers/ProductController.php

@@ -192,8 +192,8 @@ class ProductController extends BaseController
             $pyName = strtolower($py);
             $pyName = strtolower($py);
             $where['py'] = $pyName;
             $where['py'] = $pyName;
         }
         }
-        //改价和全部库存列表
-        if ($requestType == 'hasStock') {
+        //改价和全部库存花材列表
+        if ($requestType == 'changePrice' || $requestType == 'hasStockList') {
             $where['stock>'] = 0;
             $where['stock>'] = 0;
         }
         }
         if (!empty($status)) {
         if (!empty($status)) {
@@ -218,12 +218,17 @@ class ProductController extends BaseController
                 ->select($field)->asArray()->all();
                 ->select($field)->asArray()->all();
         } else {
         } else {
             if ($requestType == 'common') {
             if ($requestType == 'common') {
-                //通用
+                //通用花材列表
+                $field = 'id,py,cover,name,ratio,cost,addPrice,classId,skMore,skPrice,itemId,smallUnit,smallRatio,bigUnit,smallUnit,ratioType,variety,price,stock,stockWarning,discountPrice,presell,presellDate';
+                $itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
+                $itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);
+            } elseif ($requestType == 'hasStockList') {
+                //有库存的花材列表
                 $field = 'id,py,cover,name,ratio,cost,addPrice,classId,skMore,skPrice,itemId,smallUnit,smallRatio,bigUnit,smallUnit,ratioType,variety,price,stock,stockWarning,discountPrice,presell,presellDate';
                 $field = 'id,py,cover,name,ratio,cost,addPrice,classId,skMore,skPrice,itemId,smallUnit,smallRatio,bigUnit,smallUnit,ratioType,variety,price,stock,stockWarning,discountPrice,presell,presellDate';
                 $itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
                 $itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
                 $itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);
                 $itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);
-            } elseif ($requestType == 'hasStock') {
-                //修改价格和有库存的花材列表
+            } elseif ($requestType == 'changePrice') {
+                //修改价格列表
                 $field = 'id,py,cover,name,ratio,cost,addPrice,classId,skMore,skPrice,itemId,smallUnit,smallRatio,bigUnit,smallUnit,ratioType,variety,price,stock,stockWarning,discountPrice,presell,presellDate';
                 $field = 'id,py,cover,name,ratio,cost,addPrice,classId,skMore,skPrice,itemId,smallUnit,smallRatio,bigUnit,smallUnit,ratioType,variety,price,stock,stockWarning,discountPrice,presell,presellDate';
                 $itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
                 $itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
                 $itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);
                 $itemInfoData = ProductClass::groupProductInfo($itemInfoData, $level);