shish 11 bulan lalu
induk
melakukan
ae0b7a25c3
2 mengubah file dengan 7 tambahan dan 13 penghapusan
  1. 1 10
      app-hd/controllers/ConsoleController.php
  2. 6 3
      biz/shop/classes/ShopClass.php

+ 1 - 10
app-hd/controllers/ConsoleController.php

@@ -7,7 +7,6 @@ use bizHd\stat\classes\StatOrderClass;
 use bizHd\stat\classes\StatVisitClass;
 use bizGhs\item\classes\ItemClass;
 use common\components\dict;
-use common\components\imgUtil;
 use common\components\util;
 use bizGhs\order\classes\OrderClass;
 use Yii;
@@ -112,15 +111,7 @@ class ConsoleController extends BaseController
     public function actionInit()
     {
         $dict = dict::get($this->mainId);
-        $shop = [];
-        if (!empty($this->shop)) {
-            $shop = $this->shop->attributes;
-            //头像
-            $avatar = $shop['avatar'] ?? '';
-            $smallAvatar = imgUtil::groupImg($avatar) . "?x-oss-process=image/resize,m_fill,h_130,w_130";
-            $shop['smallAvatar'] = $smallAvatar;
-            $shop['shortAvatar'] = $avatar;
-        }
+        $shop = isset($this->shop) && !empty($this->shop) ? $this->shop->attributes : [];
         util::success(['dict' => $dict, 'shop' => $shop]);
     }
 

+ 6 - 3
biz/shop/classes/ShopClass.php

@@ -74,9 +74,12 @@ class ShopClass extends BaseClass
         }
         foreach ($list as $key => $val) {
             $shortAvatar = $val['avatar'] ?? '';
-            $avatar = imgUtil::groupImg($val['avatar']);
+            $avatar = imgUtil::groupImg($shortAvatar);
             $list[$key]['avatar'] = $avatar;
             $list[$key]['shortAvatar'] = $shortAvatar;
+            $smallAvatar = imgUtil::groupImg($shortAvatar) . "?x-oss-process=image/resize,m_fill,h_130,w_130";
+            $list[$key]['smallAvatar'] = $smallAvatar;
+
             //店长微信
             $superWx = $val['superWx'] ?? '';
             $list[$key]['superWx'] = imgUtil::groupImg($superWx) . "?x-oss-process=image/resize,m_fill,h_700,w_700";
@@ -165,7 +168,7 @@ class ShopClass extends BaseClass
         if ($ptStyle == dict::getDict('ptStyle', 'ghs')) {
             //$lsShop = self::getById($id, false, 'lsShopId');
             $lsShopId = intval($shop['lsShopId']);
-            if($lsShopId > 0){
+            if ($lsShopId > 0) {
                 $re = self::updateById($lsShopId, $shopUpdate);
             }
         }
@@ -173,7 +176,7 @@ class ShopClass extends BaseClass
         if ($ptStyle == dict::getDict('ptStyle', 'hd')) {
             //$pfShop = self::getById($id, false, 'pfShopId');
             $pfShopId = intval($shop['pfShopId']);
-            if($pfShopId > 0){
+            if ($pfShopId > 0) {
                 $re = self::updateById($pfShopId, $shopUpdate);
             }
         }