shish 3 лет назад
Родитель
Сommit
cf35b8c43b
1 измененных файлов с 12 добавлено и 2 удалено
  1. 12 2
      app-ghs/controllers/ProductController.php

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

@@ -283,7 +283,12 @@ class ProductController extends BaseController
             $itemInfoData = ProductClass::partItemGroup($itemInfoData, $level);
         } elseif ($requestType == 'stockOut') {
             //出库花材
-            $field = 'id,py,cover,name,itemId,classId,variety,price,discountPrice,stock,stockWarning,presell,ratioType,smallUnit,bigUnit,ratio,smallRatio';
+            if (in_array($this->mainId, [52, 1459, 2126, 2128])) {
+                //惠雅鲜花的不列出frontHide字段,因为他花材太多很慢了
+                $field = 'id,py,cover,name,itemId,classId,variety,price,discountPrice,stock,stockWarning,presell,ratioType,smallUnit,bigUnit,ratio,smallRatio';
+            }else{
+                $field = 'id,py,cover,name,itemId,classId,variety,price,discountPrice,stock,stockWarning,presell,ratioType,smallUnit,bigUnit,ratio,smallRatio,frontHide';
+            }
             $itemInfoData = ProductClass::getAllByCondition($where, ['inTurn' => SORT_DESC, 'actualSold' => SORT_DESC], $field);
             $itemInfoData = ProductClass::stockOutGroup($itemInfoData, $level);
         } elseif ($requestType == 'cg') {
@@ -298,7 +303,12 @@ class ProductController extends BaseController
             $itemInfoData = ProductClass::cgItemGroup($itemInfoData, $level);
         } elseif ($requestType == 'warning') {
             //库存预警
-            $field = 'id,py,cover,name,cost,itemId,classId,skPrice,variety,price,discountPrice,stock,actualSold,presell,bigUnit,stockWarning,status';
+            if (in_array($this->mainId, [52, 1459, 2126, 2128])) {
+                //惠雅鲜花的不列出frontHide字段,因为他花材太多很慢了
+                $field = 'id,py,cover,name,cost,itemId,classId,skPrice,variety,price,discountPrice,stock,actualSold,presell,bigUnit,stockWarning,status';
+            }else{
+                $field = 'id,py,cover,name,cost,itemId,classId,skPrice,variety,price,discountPrice,stock,actualSold,presell,bigUnit,stockWarning,status,frontHide';
+            }
             $itemInfoData = Product::find()->where("mainId={$this->mainId}")
                 ->andWhere('`stock`<`stockWarning`')
                 ->andWhere("delStatus=0")