瀏覽代碼

门店详情

shish 5 年之前
父節點
當前提交
ade35817c1
共有 2 個文件被更改,包括 21 次插入29 次删除
  1. 15 4
      app-ghs/controllers/ShopController.php
  2. 6 25
      app-hd/controllers/ShopController.php

+ 15 - 4
app-ghs/controllers/ShopController.php

@@ -61,13 +61,13 @@ class ShopController extends BaseController
 
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();
-        try{
+        try {
             $shop = ShopClass::addShop($data);
             $shopId = $shop['id'];
             //门店product 同步数据  linqh 2021.4.18
-            $product = ProductClass::getAllProduct($this->sjId,$this->shopId,"name,cover,classId,itemId,rank,price,priceLabel,cost,addPrice,stockWarning,weight,alias,py,ratio,bigUnit,smallUnit,bigUnitId,smallUnitId,inTurn");
+            $product = ProductClass::getAllProduct($this->sjId, $this->shopId, "name,cover,classId,itemId,rank,price,priceLabel,cost,addPrice,stockWarning,weight,alias,py,ratio,bigUnit,smallUnit,bigUnitId,smallUnitId,inTurn");
             $productData = [];
-            foreach ($product as $v){
+            foreach ($product as $v) {
                 $tmp = $v;
                 $tmp['merchantId'] = $this->sjId;
                 $tmp['shopId'] = $shopId;
@@ -77,7 +77,7 @@ class ShopController extends BaseController
             ProductClass::batchAdd($productData);
             $transaction->commit();
             util::complete();
-        }catch (\Exception $exception){
+        } catch (\Exception $exception) {
             $transaction->rollBack();
             util::fail();
         }
@@ -213,4 +213,15 @@ class ShopController extends BaseController
         util::complete();
     }
 
+    //获取门店详情 ssh 2021.4.23
+    public function actionDetail()
+    {
+        $shopId = Yii::$app->request->get('shopId');
+        if (empty($shopId)) {
+            $shopId = $this->shopId;
+        }
+        $shop = ShopClass::getShopInfo($shopId);
+        util::success(['info' => $shop]);
+    }
+
 }

+ 6 - 25
app-hd/controllers/ShopController.php

@@ -125,34 +125,15 @@ class ShopController extends BaseController
         util::complete();
     }
 
-    //获取商家的默认门店 ssh 2019.12.6
+    //获取门店详情 ssh 2021.4.23
     public function actionDetail()
     {
-        $introUserId = Yii::$app->request->get('introUserId');
-        //$merchant = $this->sj;
-        //$shop = ShopService::getDefaultShop($merchant);
-        //$ad = AdService::getValidAdList($this->sjId);
-        //新人专享礼物
-        $newUserGift = [
-            [
-                'adImgUrl' => "https://img.huahb.com/uploads/12358/202006/03/20210120220152.jpg",
-                'adName' => '图片',
-            ],
-        ];
-        if (!empty($introUserId)) {
-            //$userInfo = UserService::getUserInfo($this->adminId);
-            //$newUserGift = InviteService::hasNewGift($userInfo);
+        $shopId = Yii::$app->request->get('shopId');
+        if (empty($shopId)) {
+            $shopId = $this->shopId;
         }
-        $ad = [];
-        $shop = [
-            'address' => '福建省厦门市思明区后埭溪路128-5号',
-            'telephone' => '15280215347',
-            'openTime' => '09:00--18:00',
-            'shopName' => '国兰花尚',
-            'name' => '国兰花尚2',
-            'introduction' => '门店介绍',
-        ];
-        util::success(['ad' => $ad, 'shop' => $shop, 'newUserGift' => $newUserGift]);
+        $shop = ShopClass::getShopInfo($shopId);
+        util::success(['info' => $shop]);
     }
 
     //提现信息更新 ssh 2021.3.23