shish 5 лет назад
Родитель
Сommit
03bdfe4809

+ 0 - 4
app-hd/controllers/BaseController.php

@@ -40,10 +40,6 @@ class BaseController extends PublicController
 		if (empty($adminId)) {
 			util::notLogin();
 		}
-		$sjId = 0;
-		$sj = [];
-		$sjExtend = [];
-		$currentShopId = 0;
 		$admin = AdminClass::getAdminById($adminId, true);
 		if (empty($admin)) {
 			util::notLogin();

+ 47 - 45
app-hd/controllers/MerchantController.php

@@ -15,6 +15,8 @@ use yii\web\Controller;
 class MerchantController extends BaseController
 {
 
+    public $guestAccessAction = ['detail'];
+
     //运费设置 shish 2019.12.8
     public function actionFreightSetting()
     {
@@ -100,50 +102,50 @@ class MerchantController extends BaseController
         util::success(['ids' => $ids]);
     }
 
-	//商家信息 shish 2020.1.11
-	public function actionIntroduceShop()
-	{
-		$id = Yii::$app->request->get('id');
-		$merchant = MerchantService::getMerchantById($id);
-		if (empty($merchant)) {
-			util::fail('没有找到介绍人');
-		}
-		$merchantName = isset($merchant['merchantName']) ? $merchant['merchantName'] : '';
-		$smallLogoUrl = isset($merchant['smallLogoUrl']) ? $merchant['smallLogoUrl'] : '';
-		$logoUrl = isset($merchant['logoUrl']) ? $merchant['logoUrl'] : '';
-		$data = ['merchantName' => $merchantName, 'smallLogoUrl' => $smallLogoUrl, 'id' => $id, 'logoUrl' => $logoUrl, 'fullAddress' => '暂无'];
-		util::success($data);
-	}
-	
-	//当前用户获取门店信息
-	public function actionGetShopInfo()
-	{
-		$merchant = $this->sj;
-		$merchant['defaultShop'] = ShopService::getDefaultShopInfo($merchant);
-		util::success($merchant);
-	}
-	
-	//当前用户获取商家信息
-	public function actionGetInfo()
-	{
-		$merchant = MerchantService::getInfo($this->sj, $this->sjExtend);
-		util::success($merchant);
-	}
-	
-	//客户的会员等级 shish 2020.1.2
-	public function actionUserGrade()
-	{
-		$list = MerchantExtendService::getGradeList($this->sjExtend, 'asc', false);
-		util::success($list);
-	}
-	
-	//获取商家的到期时间 shish 2020.2.22
-	public function actionGetDeadline()
-	{
-		$id = Yii::$app->request->get('merchantId');
-		$merchant = MerchantService::getById($id);
-		$deadline = $merchant['deadline'];
-		util::success(['date' => $deadline]);
-	}
+    //商家信息 shish 2020.1.11
+    public function actionIntroduceShop()
+    {
+        $id = Yii::$app->request->get('id');
+        $merchant = MerchantService::getMerchantById($id);
+        if (empty($merchant)) {
+            util::fail('没有找到介绍人');
+        }
+        $merchantName = isset($merchant['merchantName']) ? $merchant['merchantName'] : '';
+        $smallLogoUrl = isset($merchant['smallLogoUrl']) ? $merchant['smallLogoUrl'] : '';
+        $logoUrl = isset($merchant['logoUrl']) ? $merchant['logoUrl'] : '';
+        $data = ['merchantName' => $merchantName, 'smallLogoUrl' => $smallLogoUrl, 'id' => $id, 'logoUrl' => $logoUrl, 'fullAddress' => '暂无'];
+        util::success($data);
+    }
+
+    //当前用户获取门店信息
+    public function actionGetShopInfo()
+    {
+        $merchant = $this->sj;
+        $merchant['defaultShop'] = ShopService::getDefaultShopInfo($merchant);
+        util::success($merchant);
+    }
+
+    //当前用户获取商家信息
+    public function actionGetInfo()
+    {
+        $merchant = MerchantService::getInfo($this->sj, $this->sjExtend);
+        util::success($merchant);
+    }
+
+    //客户的会员等级 shish 2020.1.2
+    public function actionUserGrade()
+    {
+        $list = MerchantExtendService::getGradeList($this->sjExtend, 'asc', false);
+        util::success($list);
+    }
+
+    //获取商家的到期时间 shish 2020.2.22
+    public function actionGetDeadline()
+    {
+        $id = Yii::$app->request->get('merchantId');
+        $merchant = MerchantService::getById($id);
+        $deadline = $merchant['deadline'];
+        util::success(['date' => $deadline]);
+    }
 
 }

+ 11 - 2
biz/wx/classes/WxOpenClass.php

@@ -21,10 +21,14 @@ class WxOpenClass extends BaseClass
         $arr = [];
         $ghsMini = WxMiniBaseClass::getById($wxMiniBaseId);
         $arr['ghs']['miniAppId'] = $ghsMini['miniAppId'] ?? '';
-        $retailOpen = self::getRetailOpen();
+        $retailOpen = self::getHdOpen();
         $wxMiniBaseId = $retailOpen['wxMiniBaseId'] ?? 0;
         $wxMini = WxMiniBaseClass::getById($wxMiniBaseId);
         $arr['hd']['miniAppId'] = $wxMini['miniAppId'] ?? '';
+        $mallOpen = self::getMallOpen();
+        $wxMiniBaseId = $mallOpen['wxMiniBaseId'] ?? 0;
+        $wxMini = WxMiniBaseClass::getById($wxMiniBaseId);
+        $arr['mall']['miniAppId'] = $wxMini['miniAppId'] ?? '';
         return $arr;
     }
 
@@ -35,9 +39,14 @@ class WxOpenClass extends BaseClass
     }
 
     //取零售平台信息 shish 2021.2.25
-    public static function getRetailOpen()
+    public static function getHdOpen()
     {
         return self::getByCondition(['style' => self::OPEN_STYLE_HD]);
     }
 
+    public static function getMallOpen()
+    {
+        return self::getByCondition(['style' => self::OPEN_STYLE_MALL]);
+    }
+
 }