shish před 5 roky
rodič
revize
8ee958d4e1

+ 0 - 3
app-ghs/controllers/ShopController.php

@@ -6,15 +6,12 @@ use biz\sj\services\MerchantExtendService;
 use bizGhs\admin\classes\AdminClass;
 use bizGhs\admin\classes\AdminClass;
 use bizGhs\merchant\classes\ShopClass;
 use bizGhs\merchant\classes\ShopClass;
 use bizGhs\merchant\services\ShopService;
 use bizGhs\merchant\services\ShopService;
-use bizGhs\product\classes\ProductClass;
 use common\components\dirUtil;
 use common\components\dirUtil;
 use common\components\httpUtil;
 use common\components\httpUtil;
 use common\components\imgUtil;
 use common\components\imgUtil;
 use common\components\util;
 use common\components\util;
 use common\components\wxUtil;
 use common\components\wxUtil;
-use jzweb\open\weixin\lib\user;
 use Yii;
 use Yii;
-use yii\web\UrlManager;
 
 
 class ShopController extends BaseController
 class ShopController extends BaseController
 {
 {

+ 1 - 1
app-hd/controllers/ShopController.php

@@ -29,7 +29,7 @@ class ShopController extends BaseController
         $where = [];
         $where = [];
         $where['merchantId'] = $this->sjId;
         $where['merchantId'] = $this->sjId;
         $where['delStatus'] = 0;
         $where['delStatus'] = 0;
-        $list = ShopService::getShopList($where);
+        $list = \bizGhs\merchant\classes\ShopClass::getShopList($where);
         util::success($list);
         util::success($list);
     }
     }
 
 

+ 8 - 6
biz-ghs/merchant/classes/ShopClass.php

@@ -27,8 +27,10 @@ class ShopClass extends BaseClass
                 continue;
                 continue;
             }
             }
             $list[$key]['img'] = json_decode($val['img'], true);
             $list[$key]['img'] = json_decode($val['img'], true);
-            foreach ($list[$key]['img'] as $img) {
-                $list[$key]['imgUrl'][] = imgUtil::groupImg($img);
+            if (isset($list[$key]['img']) && is_array($list[$key]['img'])) {
+                foreach ($list[$key]['img'] as $img) {
+                    $list[$key]['imgUrl'][] = imgUtil::groupImg($img);
+                }
             }
             }
         }
         }
         return $list;
         return $list;
@@ -60,13 +62,13 @@ class ShopClass extends BaseClass
             util::fail('门店名称已经存在');
             util::fail('门店名称已经存在');
         }
         }
         //补充fullAddress linqh 2021.4.18
         //补充fullAddress linqh 2021.4.18
-        $data['fullAddress'] = $data['province'].$data['city'].$data['address'].$data['floor'];
+        $data['fullAddress'] = $data['province'] . $data['city'] . $data['address'] . $data['floor'];
         $shop = self::add($data);
         $shop = self::add($data);
         $newShopId = $shop['id'];
         $newShopId = $shop['id'];
         //初始化花材 linqh 2021.5.11
         //初始化花材 linqh 2021.5.11
-        $adminId = $data['adminId']??0;
-        $shopId = $data['shopId']??0;
-        ProductClass::newShopInitProduct($data['merchantId'],$shopId,$newShopId,$adminId);
+        $adminId = $data['adminId'] ?? 0;
+        $shopId = $data['shopId'] ?? 0;
+        ProductClass::newShopInitProduct($data['merchantId'], $shopId, $newShopId, $adminId);
         return $shop;
         return $shop;
     }
     }