shish il y a 5 ans
Parent
commit
0d2335622f
2 fichiers modifiés avec 21 ajouts et 22 suppressions
  1. 18 17
      app-mall/controllers/ShopController.php
  2. 3 5
      biz-hd/ad/classes/AdClass.php

+ 18 - 17
app-mall/controllers/ShopController.php

@@ -15,22 +15,23 @@ use common\components\util;
 
 class ShopController extends BaseController
 {
-	
-	//获取商家的默认门店 ssh 2019.12.6
-	public function actionDetail()
-	{
-		$introUserId = Yii::$app->request->get('introUserId');
-		$sj = $this->sj->attributes;
-		$shop = ShopService::getDefaultShop($sj);
-		$ad = AdService::getValidAdList($this->sjId);
-		
-		//新人专享礼物
-		$newUserGift = [];
-		if (!empty($introUserId)) {
-			$userInfo = UserService::getUserInfo($this->userId);
-			$newUserGift = InviteService::hasNewGift($userInfo);
-		}
-		util::success(['ad' => $ad, 'shop' => $shop, 'newUserGift' => $newUserGift]);
-	}
+
+    //获取商家的默认门店 ssh 2019.12.6
+    public function actionDetail()
+    {
+        $introUserId = Yii::$app->request->get('introUserId');
+        $shop = isset($this->shop) && !empty($this->shop) ? $this->shop->attributes : [];
+        $ad = [
+            ['adImgUrl' => 'https://img.theflorist.cn/example/shop/1.jpg']
+        ];
+
+        //新人专享礼物
+        $newUserGift = [];
+        if (!empty($introUserId)) {
+            $userInfo = UserService::getUserInfo($this->userId);
+            $newUserGift = InviteService::hasNewGift($userInfo);
+        }
+        util::success(['ad' => $ad, 'shop' => $shop, 'newUserGift' => $newUserGift]);
+    }
 
 }

+ 3 - 5
biz-hd/ad/classes/AdClass.php

@@ -120,12 +120,10 @@ class AdClass extends BaseClass
     public static function initAdd($sjId)
     {
         $time = time();
-        $imgHost = imgUtil::getPrefix();
         $list = [
-            ['adName' => '培训图', 'adImg' => '/example/mall/1.jpg', 'type' => 0, 'startTime' => 0, 'endTime' => 4102416000, 'addTime' => $time, 'sjId' => $sjId, 'status' => 1],
-            ['adName' => '花礼', 'adImg' => '/example/mall/2.jpg', 'type' => 0, 'startTime' => 0, 'endTime' => 4102416000, 'addTime' => $time, 'sjId' => $sjId, 'status' => 1],
-            ['adName' => '花艺', 'adImg' => '/example/mall/3.jpg', 'type' => 0, 'startTime' => 0, 'endTime' => 4102416000, 'addTime' => $time, 'sjId' => $sjId, 'status' => 1],
-            ['adName' => '门店图片', 'adImg' => '/example/shop/1.jpg', 'type' => 1, 'startTime' => 0, 'endTime' => 4102416000, 'addTime' => $time, 'sjId' => $sjId, 'status' => 1],
+            ['adName' => '花礼', 'adImg' => '/example/mall/1.jpg?v=1', 'type' => 0, 'startTime' => 0, 'endTime' => 4102416000, 'addTime' => $time, 'sjId' => $sjId, 'status' => 1],
+            ['adName' => '花礼', 'adImg' => '/example/mall/2.jpg?v=1', 'type' => 0, 'startTime' => 0, 'endTime' => 4102416000, 'addTime' => $time, 'sjId' => $sjId, 'status' => 1],
+            ['adName' => '花礼', 'adImg' => '/example/mall/3.jpg?v=1', 'type' => 0, 'startTime' => 0, 'endTime' => 4102416000, 'addTime' => $time, 'sjId' => $sjId, 'status' => 1],
         ];
         foreach ($list as $val) {
             self::add($val);