shish 3 years ago
parent
commit
7b32a5ba7e

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

@@ -244,7 +244,7 @@ class ProductController extends BaseController
                     ->andWhere('`stock`<`stockWarning`')
                     ->andWhere("delStatus=0")
                     ->select($field)->asArray()->all();
-                $itemInfoData = ProductClass::cgItemGroup($itemInfoData, $level);
+                $itemInfoData = ProductClass::warningGroup($itemInfoData, $level);
             } else {
                 //通用
                 $field = 'id,py,cover,name,ratio,cost,addPrice,classId,skMore,skPrice,itemId,smallUnit,smallRatio,bigUnit,smallUnit,ratioType,variety,price,stock,stockWarning,discountPrice,presell,presellDate';

+ 10 - 0
biz-ghs/product/classes/ProductClass.php

@@ -101,6 +101,16 @@ class ProductClass extends BaseClass
         return current($list);
     }
 
+    //花材列表用到的数据组合 ssh 20221225
+    public static function warningGroup($list, $level = 0)
+    {
+        foreach ($list as $k => $v) {
+            $shortCover = $v['cover'] ?? '';
+            $list[$k]['cover'] = imgUtil::groupImg($shortCover) . "?x-oss-process=image/resize,m_fill,h_100,w_100";
+        }
+        return $list;
+    }
+
     //花材列表用到的数据组合 ssh 20221225
     public static function cgItemGroup($list, $level = 0)
     {