Bladeren bron

获取手机验证码

shish 6 jaren geleden
bovenliggende
commit
ea22e1de6e

+ 25 - 0
app/business/controllers/WxShareController.php

@@ -0,0 +1,25 @@
+<?php
+
+namespace business\controllers;
+
+use common\components\jsSDK;
+use common\components\util;
+use Yii;
+
+class WxShareController extends BaseController
+{
+
+	//取微信分享的参数 shish 2020.2.22
+	public function actionGetParams()
+	{
+		if ($this->isWx) {
+			util::fail('不是微信环境');
+		}
+		$url = Yii::$app->request->get('url');
+		$jsSDK = new jsSDK();//微信分享
+		$merchant = $this->merchant;
+		$return = $jsSDK->GetSignPackage($merchant, $url);
+		util::success($return);
+	}
+
+}

+ 25 - 0
app/client/controllers/WxShareController.php

@@ -0,0 +1,25 @@
+<?php
+
+namespace client\controllers;
+
+use common\components\jsSDK;
+use common\components\util;
+use Yii;
+
+class WxShareController extends BaseController
+{
+	
+	//取微信分享的参数 shish 2020.2.22
+	public function actionGetParams()
+	{
+		if ($this->isWx) {
+			util::fail('不是微信环境');
+		}
+		$url = Yii::$app->request->get('url');
+		$jsSDK = new jsSDK();//微信分享
+		$merchant = $this->merchant;
+		$return = $jsSDK->GetSignPackage($merchant, $url);
+		util::success($return);
+	}
+
+}

+ 7 - 1
app/www/controllers/ApplyController.php

@@ -80,5 +80,11 @@ class ApplyController extends BaseController
 		$out = ['region' => $regionTree, 'txMapKey' => $mapKey];
 		$out = ['region' => $regionTree, 'txMapKey' => $mapKey];
 		util::success($out);
 		util::success($out);
 	}
 	}
-	
+
+	//获取申请的验证码 shish 2020.2.23
+	public function actionGetValidateCode()
+	{
+		util::success(['code' => rand(1111, 9999)]);
+	}
+
 }
 }

+ 11 - 4
app/www/controllers/MerchantController.php

@@ -32,11 +32,18 @@ class MerchantController extends BaseController
 	}
 	}
 	
 	
 	//商家信息 shish 2020.1.11
 	//商家信息 shish 2020.1.11
-	public function actionDetail()
+	public function actionIntroduceShop()
 	{
 	{
 		$id = Yii::$app->request->get('id');
 		$id = Yii::$app->request->get('id');
-		$merchant = MerchantService::getMerchantById(12358);
-		util::success($merchant);
+		$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);
 	}
 	}
-
+	
 }
 }