林琦海 5 лет назад
Родитель
Сommit
ca0d853f65

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

@@ -65,7 +65,7 @@ class ShopController extends BaseController
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();
         try {
-            $shop = ShopClass::addShop($data);
+            $shop = \biz\shop\classes\ShopClass::addShop($data);
             $transaction->commit();
             util::complete();
         } catch (\Exception $exception) {

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

@@ -52,7 +52,7 @@ class ShopController extends BaseController
         $data['merchantId'] = $this->sjId;
         $data['shopId'] = $this->shopId;
         $data['adminId'] = $this->adminId;
-        ShopService::addShop($data);
+        ShopClass::addShop($data);
         util::complete();
     }
 

+ 8 - 0
biz/shop/classes/ShopClass.php

@@ -2,6 +2,7 @@
 
 namespace biz\shop\classes;
 
+use bizGhs\product\classes\ProductClass;
 use bizHd\admin\classes\ShopAdminClass;
 use biz\sj\classes\MerchantClass;
 use common\components\dirUtil;
@@ -72,7 +73,14 @@ class ShopClass extends BaseClass
         if (!empty($exists)) {
             util::fail('门店名称已经存在');
         }
+        //补充fullAddress linqh 2021.4.18
+        $data['fullAddress'] = $data['province'].$data['city'].$data['address'].$data['floor'];
         $shop = self::add($data);
+        $newShopId = $shop['id'];
+        //初始化花材 linqh 2021.5.11
+        $adminId = $data['adminId']??0;
+        $shopId = $data['shopId']??0;
+        ProductClass::newShopInitProduct($data['merchantId'],$shopId,$newShopId,$adminId);
         return $shop;
     }