shish 4 жил өмнө
parent
commit
38ebf60ee5

+ 11 - 0
app-ghs/controllers/XjController.php

@@ -3,6 +3,7 @@
 namespace ghs\controllers;
 namespace ghs\controllers;
 
 
 use biz\product\classes\XjClass;
 use biz\product\classes\XjClass;
+use common\components\imgUtil;
 use common\components\util;
 use common\components\util;
 use Yii;
 use Yii;
 
 
@@ -30,6 +31,16 @@ class XjController extends BaseController
     public function actionGetFilterXj()
     public function actionGetFilterXj()
     {
     {
         $list = XjClass::getAllByCondition(['shopId' => $this->shopId, 'delStatus' => 0], null, '*');
         $list = XjClass::getAllByCondition(['shopId' => $this->shopId, 'delStatus' => 0], null, '*');
+        if (!empty($list)) {
+            foreach ($list as $key => $val) {
+                $shortCover = $val['cover'] ?? '';
+                $cover = imgUtil::groupImg($shortCover) . "?x-oss-process=image/resize,m_fill,h_130,w_130";
+                $bigCover = imgUtil::groupImg($shortCover) . "?x-oss-process=image/resize,m_fill,h_700,w_700";
+                $list[$key]['cover'] = $cover;
+                $list[$key]['bigCover'] = $bigCover;
+                $list[$key]['shortCover'] = $shortCover;
+            }
+        }
         util::success(['list' => $list]);
         util::success(['list' => $list]);
     }
     }