JoinController.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  1. <?php
  2. namespace openend\controllers;
  3. use common\services\xhMerchantExtendService;
  4. use Yii;
  5. use yii\web\Controller;
  6. use common\services\xhApplyOrderService;
  7. use common\services\xhWxMenuService;
  8. use common\services\xhMerchantService;
  9. use common\services\xhInviteService;
  10. use common\components\util;
  11. use common\components\configDict;
  12. use common\components\weixinOpenUtil;
  13. use common\services\xhWxOpenService;
  14. use common\components\stringUtil;
  15. use common\components\weixinUtil;
  16. use common\services\xhSetMealService;
  17. class JoinController extends PublicController
  18. {
  19. public $withoutLogin = ['callback-create-first-merchant'];
  20. public function actionApply()
  21. {
  22. $id = configDict::getConfig('openId');
  23. $open = xhWxOpenService::getById($id);
  24. $pre = weixinOpenUtil::getPreAuthCode($open);
  25. $appId = $open['appId'];
  26. $oData = [];
  27. $oData['preAuthCodeTime'] = date("Y-m-d H:i:s");//设置预授码过期,让下个用户可以获取新的预授码
  28. xhWxOpenService::updateById($id, $oData);
  29. $url = $this->openUrl . '/join/callback';
  30. $merchantId = $open['merchantId'];//如果平台没有绑定商家,先去创建第一个商家
  31. if (empty($merchantId)) {
  32. $url = $this->openUrl . '/join/callback-create-first-merchant';
  33. }
  34. $redirect = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid={$appId}&pre_auth_code={$pre}&redirect_uri={$url}";
  35. return $this->renderPartial('apply', ['url' => $redirect]);
  36. }
  37. public function actionCheckMerchantName()
  38. {
  39. $get = Yii::$app->request->get();
  40. $merchantName = isset($get['merchantName']) ? $get['merchantName'] : '';
  41. $m = xhMerchantService::getByMerchantName($merchantName);
  42. if (!empty($m)) {
  43. util::failInfo('公众号名称已经使用');
  44. }
  45. util::successInfo();
  46. }
  47. /**
  48. * 下载微信里的图片到服务器
  49. */
  50. public function actionDownloadWxImg()
  51. {
  52. $get = Yii::$app->request->get();
  53. $mediaId = isset($get['mediaId']) ? $get['mediaId'] : '';
  54. $imgList = weixinUtil::downloadmediaIdImg($this->merchant, $mediaId);
  55. if (!empty($imgList)) {
  56. util::successInfo('操作成功', 'A0001', $imgList);
  57. }
  58. util::failInfo();
  59. }
  60. /**
  61. * 创建第一个商家
  62. */
  63. public function actionCallbackCreateFirstMerchant()
  64. {
  65. $get = Yii::$app->request->get();
  66. if (isset($get['auth_code']) == false) {
  67. return $this->renderPartial('hint', ['msg' => '公众号授权回调未成功']);
  68. }
  69. $code = $get['auth_code'];
  70. //使用授权码换取公众号的接口调用凭据和授权信息
  71. $authorizer = weixinOpenUtil::getAuthorizer($code);
  72. if (isset($authorizer['authorization_info']) == false) {
  73. return $this->renderPartial('hint', ['msg' => '未换取公众号的接口调用凭据和授权信息']);
  74. }
  75. $info = $authorizer['authorization_info'];
  76. $authorizer_appid = $info['authorizer_appid'];
  77. $authorizer_access_token = $info['authorizer_access_token'];
  78. $expires_in = $info['expires_in'];//7200
  79. $authorizer_refresh_token = $info['authorizer_refresh_token'];
  80. //获取授权方的公众号帐号基本信息
  81. $authorizerDetailInfo = weixinOpenUtil::getAuthorizerInfo($authorizer_appid);
  82. if (isset($authorizerDetailInfo['authorizer_info']) == false) {
  83. return $this->renderPartial('hint', ['msg' => '没有获取到公众号帐号基本信息']);
  84. }
  85. $authorizer_info = $authorizerDetailInfo['authorizer_info'];
  86. $nick_name = $authorizer_info['nick_name'];
  87. $head_img = $authorizer_info['head_img'];
  88. $service_type_info = $authorizer_info['service_type_info'];
  89. if ($service_type_info['id'] != 2) {
  90. return $this->renderPartial('hint', ['msg' => '公众号不是服务号']);
  91. }
  92. $verify_type_info = $authorizer_info['verify_type_info'];
  93. if ($verify_type_info['id'] != 0) {
  94. return $this->renderPartial('hint', ['msg' => '公众号还没有认证哦']);
  95. }
  96. $user_name = $authorizer_info['user_name'];
  97. $alias = $authorizer_info['alias'];
  98. $qrcode_url = $authorizer_info['qrcode_url'];
  99. $business_info = $authorizer_info['business_info'];
  100. $open_pay = $business_info['open_pay'];
  101. $merchant = xhMerchantService::getByAppId($authorizer_appid);
  102. $wxAccessTokenTime = date("Y-m-d H:i:s", (time() + $expires_in - 100));//安全起见,将过期时间设置得比微信里还短100秒
  103. if (!empty($merchant)) {
  104. return $this->renderPartial('hint', ['msg' => '平台已经关联公众号了']);
  105. }
  106. //引导生成商家
  107. $date = date("Y-m-d H:i:s");
  108. $trainDemo = configDict::getConfig('trainDemo');
  109. $logo = xhMerchantService::logoSave($head_img, $authorizer_appid);
  110. $appData['logo'] = $logo;
  111. $wxQrcodeUrl = xhMerchantService::qrCodeSave($qrcode_url, $authorizer_appid);
  112. $appData['wxQrcodeUrl'] = $wxQrcodeUrl;
  113. $appData['wxAppId'] = $authorizer_appid;
  114. $appData['wxUserName'] = $user_name;
  115. $appData['wxAliasName'] = $alias;
  116. $appData['wxAccessToken'] = $authorizer_access_token;
  117. $appData['wxAccessTokenTime'] = $wxAccessTokenTime;
  118. $appData['wxRefreshToken'] = $authorizer_refresh_token;
  119. $appData['accountStyle'] = 0;//认证服务号
  120. $appData['status'] = 0;//待审核
  121. $appData['createTime'] = $date;
  122. $appData['updateTime'] = $date;
  123. $appData['shopLat'] = (string)0;
  124. $appData['shopLong'] = (string)0;
  125. $appData['shopPrecision'] = (string)0;
  126. $appData['account'] = $trainDemo['platform']['account'];
  127. $appData['adminId'] = 0;
  128. $appData['wxToken'] = stringUtil::buildWxToken(0);
  129. $appData['shopPhotoList'] = '';
  130. $appData['merchantName'] = $nick_name;
  131. $appData['shopProvince'] = '福建';
  132. $appData['shopCity'] = '厦门';
  133. $appData['shopDist'] = '思明区';
  134. $appData['alipayAccount'] = 'shishaohua8879@sina.com';
  135. $appData['alipayAccountName'] = '石少华';
  136. $appData['agentLevel'] = 1;//默认设置为代理商
  137. $merchant = xhMerchantService::applyCreateMerchant($appData);
  138. $wxOpenId = configDict::getConfig('openId');
  139. $merchantId = $merchant['id'];
  140. $account = $merchant['id'];
  141. $createTime = date("Y-m-d H:i:s");
  142. $orderId = 'A' . stringUtil::buildOrderNo();
  143. $orderData = ['id' => $orderId, 'userId' => 0, 'applyName' => $nick_name, 'email' => '',
  144. 'createTime' => $createTime, 'accountId' => 0, 'inviteCode' => '', 'merchantId' => $merchantId, 'invitedMerchantId' => $merchantId,
  145. 'prePrice' => 0, 'actPrice' => 0, 'deadline' => time() + 2592000, 'inviteCodeStatus' => 0, 'payStatus' => 1,
  146. ];
  147. xhApplyOrderService::add($orderData);//保存订单信息
  148. xhWxOpenService::updateById($wxOpenId, ['merchantId' => $merchantId]);
  149. xhWxMenuService::applyInit($merchant);//初始化微信菜单
  150. $openMerchant = xhWxOpenService::getMerchant();
  151. $openMerchantAccount = $openmerchant['id'];
  152. //将新生成的商家account加密传到后台绑定管理员,密钥有效期5分钟
  153. $newAccount = urlencode(stringUtil::authcode($account, 'ENCODE', 300));
  154. $this->redirect(Yii::$app->params['adminUrl'] . '/admin/generate?account=' . $openMerchantAccount . '&newAccount=' . $newAccount);
  155. }
  156. public function actionCallback()
  157. {
  158. $get = Yii::$app->request->get();
  159. if (isset($get['auth_code']) == false) {
  160. return $this->renderPartial('hint', ['msg' => '公众号授权回调未成功']);
  161. }
  162. $code = $get['auth_code'];
  163. //使用授权码换取公众号的接口调用凭据和授权信息
  164. $authorizer = weixinOpenUtil::getAuthorizer($code);
  165. if (isset($authorizer['authorization_info']) == false) {
  166. return $this->renderPartial('hint', ['msg' => '未换取公众号的接口调用凭据和授权信息']);
  167. }
  168. $info = $authorizer['authorization_info'];
  169. $authorizer_appid = $info['authorizer_appid'];
  170. $authorizer_access_token = $info['authorizer_access_token'];
  171. $expires_in = $info['expires_in'];//7200
  172. $authorizer_refresh_token = $info['authorizer_refresh_token'];
  173. //获取授权方的基本信息
  174. $authorizerDetailInfo = weixinOpenUtil::getAuthorizerInfo($authorizer_appid);
  175. print_r($authorizerDetailInfo);
  176. if (isset($authorizerDetailInfo['authorizer_info']) == false) {
  177. return $this->renderPartial('hint', ['msg' => '没有获取到公众号帐号基本信息']);
  178. }
  179. $authorizer_info = $authorizerDetailInfo['authorizer_info'];
  180. $nick_name = $authorizer_info['nick_name'];
  181. $head_img = $authorizer_info['head_img'];
  182. $service_type_info = $authorizer_info['service_type_info'];
  183. if ($service_type_info['id'] != 2) {
  184. //return $this->renderPartial('hint',['msg' => '公众号不是服务号,appid:'.$authorizer_appid.' refresh:'.$authorizer_refresh_token]);
  185. }
  186. $verify_type_info = $authorizer_info['verify_type_info'];
  187. if ($verify_type_info['id'] != 0) {
  188. //return $this->renderPartial('hint',['msg' => '公众号还没有认证哦']);
  189. }
  190. $user_name = $authorizer_info['user_name'];
  191. $alias = $authorizer_info['alias'];
  192. $qrcode_url = $authorizer_info['qrcode_url'];
  193. $business_info = $authorizer_info['business_info'];
  194. $open_pay = $business_info['open_pay'];
  195. $accessTokenTime = date("Y-m-d H:i:s", (time() + $expires_in - 100));//安全起见,将过期时间设置得比微信里还短100秒
  196. //小程序
  197. if (isset($authorizer_info['MiniProgramInfo']) && !empty($authorizer_info['MiniProgramInfo'])) {
  198. $merchant = xhMerchantService::getByCondition(['miniAppId' => $authorizer_appid]);
  199. if (empty($merchant)) {
  200. Yii::info('没有小程序信息 appid:' . $authorizer_appid);
  201. echo '没有小程序信息 appid:' . $authorizer_appid;
  202. Yii::$app->end();
  203. }
  204. $merchantId = $merchant['id'];
  205. xhMerchantExtendService::updateByMerchantId($merchantId, ['miniAccessToken' => $authorizer_access_token, 'miniAccessTokenTime' => $accessTokenTime, 'miniRefreshToken' => $authorizer_refresh_token]);
  206. Yii::info('小程序信息更新成功:' . json_encode($authorizer_info));
  207. echo "<pre>";
  208. echo "小程序信息更新成功";
  209. } else {
  210. $merchant = xhMerchantService::getByAppId($authorizer_appid);
  211. Yii::info('appId:' . $authorizer_appid);
  212. $set = xhSetMealService::getRandOne();
  213. if (empty($set)) {
  214. return $this->renderPartial('hint', ['msg' => '没有套餐信息']);
  215. }
  216. if (empty($merchant)) {
  217. echo '这个商家没有生成过基本信息。appid:' . $authorizer_appid;
  218. Yii::$app->end();
  219. }
  220. if (empty($merchant)) {
  221. echo '新建商家能力暂时关闭';
  222. Yii::$app->end();
  223. //没有生成商家,引导进去设置
  224. $session = Yii::$app->session;
  225. $session['wxAppId'] = $authorizer_appid;
  226. $session['wxUserName'] = $user_name;
  227. $session['wxAliasName'] = $alias;
  228. $session['wxAccessToken'] = $authorizer_access_token;
  229. $session['wxAccessTokenTime'] = $accessTokenTime;
  230. $session['wxRefreshToken'] = $authorizer_refresh_token;
  231. $session['logo'] = $head_img;
  232. $session['wxQrcodeUrl'] = $qrcode_url;
  233. $session['allowGenerateMerchant'] = 'ok';//经过授权流程,允许允许生成商家
  234. $trainDemo = configDict::getConfig('trainDemo');
  235. $demoName = $trainDemo['merchant']['name'];//培训演示的公众号
  236. return $this->renderPartial('callback', ['merchantName' => $nick_name, 'set' => $set, 'demoName' => $demoName]);
  237. }
  238. $cData = [];
  239. $cData['wxAccessToken'] = $authorizer_access_token;
  240. $cData['wxAccessTokenTime'] = $accessTokenTime;
  241. $cData['wxRefreshToken'] = $authorizer_refresh_token;
  242. //审核通过
  243. $cData['status'] = 1;
  244. $merchantId = $merchant['id'];
  245. xhMerchantService::updateById($merchantId, $cData);
  246. }
  247. echo $authorizer_appid . ' ';
  248. exit('ok');
  249. $price = $set['price'];
  250. $now = time();
  251. $apply = xhApplyOrderService::getByMerchantId($merchantId);
  252. if (empty($apply)) {
  253. return $this->renderPartial('hint', ['msg' => '没有申请记录']);
  254. }
  255. $orderId = $apply['id'];
  256. $price = $apply['actPrice'];
  257. $openMerchant = xhWxOpenService::getMerchant();
  258. $openMerchantAccount = $openmerchant['id'];
  259. $account = $merchant['id'];
  260. //将新生成的商家account加密传到后台绑定管理员,密钥有效期5分钟
  261. $newAccount = urlencode(stringUtil::authcode($account, 'ENCODE', 300));
  262. if ($apply['payStatus'] == 1) {
  263. if (empty($merchant['adminId'])) {
  264. $this->redirect(Yii::$app->params['adminUrl'] . '/admin/generate?account=' . $openMerchantAccount . '&newAccount=' . $newAccount);
  265. util::end();
  266. }
  267. return $this->renderPartial('hint', ['msg' => '恭喜!您已申请成功。']);
  268. }
  269. if ($price > 0) {
  270. $this->redirect(Yii::$app->params['openUrl'] . '/pay/apply?orderId=' . $apply['id']);
  271. util::end();
  272. } else {
  273. $inviteCode = $order['inviteCode'];
  274. $now = time();
  275. if (!empty($inviteCode)) {
  276. $invite = xhInviteService::getByCode($inviteCode);
  277. if (empty($invite)) {
  278. return $this->renderPartial('hint', ['msg' => '邀请码不存在']);
  279. }
  280. if ($invite['takeStatus'] == 1) {//邀请码未使用,并且没有过期
  281. return $this->renderPartial('hint', ['msg' => '邀请码已经使用,请联系客服']);
  282. }
  283. $inviteDeadline = $invite['deadline'];
  284. if ($now > $inviteDeadline) {
  285. return $this->renderPartial('hint', ['msg' => '邀请码已经过期,请联系客服']);
  286. }
  287. xhInviteService::updateByCode($inviteCode, ['takeStatus' => 1, 'inviteUseTo' => 0, 'targetId' => $orderId, 'invitedMerchantId' => $merchantId]);
  288. }
  289. $updateData = ['inviteCodeStatus' => 1, 'payStatus' => 1, 'payWay' => 0, 'invitedMerchantId' => $merchantId];
  290. xhApplyOrderService::updateById($orderId, $updateData);
  291. $this->redirect(Yii::$app->params['adminUrl'] . '/admin/generate?account=' . $openMerchantAccount . '&newAccount=' . $newAccount);
  292. util::end();
  293. }
  294. }
  295. public function actionResult()
  296. {
  297. $get = Yii::$app->request->get();
  298. $id = isset($get['id']) ? $get['id'] : 0;
  299. $merchant = xhMerchantService::getById($id);
  300. $status = configDict::getConfig('merchantStatusName');
  301. $orMechantId = configDict::getConfig('merchantId');
  302. $originalMerchant = xhMerchantService::getById($orMechantId);
  303. return $this->renderPartial('result', ['originalMerchant' => $originalMerchant, 'merchant' => $merchant, 'status' => $status]);
  304. }
  305. /**
  306. * 商家申请入驻
  307. */
  308. public function actionAddMerchant()
  309. {
  310. $post = Yii::$app->request->post();
  311. $session = Yii::$app->session;
  312. if (isset($session['allowGenerateMerchant']) == false) {
  313. //util::failInfo('没有经过授权的操作');
  314. }
  315. unset($post['_csrf']);
  316. if (isset($session['wxAppId']) == false || empty($session['wxAppId'])) {
  317. util::failInfo('公众号appId不存在');
  318. }
  319. $wxAppId = $session['wxAppId'];
  320. if (isset($session['logo'])) {
  321. $logo = xhMerchantService::logoSave($session['logo'], $wxAppId);
  322. $post['logo'] = $logo;
  323. }
  324. if (isset($session['wxQrcodeUrl'])) {
  325. $wxQrcodeUrl = xhMerchantService::qrCodeSave($session['wxQrcodeUrl'], $wxAppId);
  326. $post['wxQrcodeUrl'] = $wxQrcodeUrl;
  327. }
  328. $date = date("Y-m-d H:i:s");
  329. $inviteCode = isset($post['inviteCode']) ? $post['inviteCode'] : '';
  330. $accountStyle = configDict::getConfig('accountStyle');
  331. $merchantStatus = configDict::getConfig('merchantStatus');
  332. $serviceAccount = $accountStyle['serviceAccount'];//认证服务号
  333. $checking = $merchantStatus['checking'];//审核中
  334. $merchantName = !empty($post['merchantName']) ? $post['merchantName'] : '';
  335. $exists = xhMerchantService::getByMerchantName($merchantName);
  336. if (!empty($exists)) {
  337. util::failInfo('花店名称已经存在了');
  338. }
  339. $post['wxAppId'] = $wxAppId;
  340. $post['wxUserName'] = $session['wxUserName'];
  341. $post['wxAliasName'] = $session['wxAliasName'];
  342. $post['wxAccessToken'] = $session['wxAccessToken'];
  343. $post['wxAccessTokenTime'] = $session['wxAccessTokenTime'];
  344. $post['wxRefreshToken'] = $session['wxRefreshToken'];
  345. $post['accountStyle'] = $serviceAccount;//认证服务号
  346. $post['status'] = $checking;//待审
  347. $post['createTime'] = $date;
  348. $post['updateTime'] = $date;
  349. $post['shopLat'] = isset($post['shopLat']) ? (string)$post['shopLat'] : (string)0;
  350. $post['shopLong'] = isset($post['shopLong']) ? (string)$post['shopLong'] : (string)0;
  351. $post['shopPrecision'] = isset($post['shopPrecision']) ? (string)$post['shopPrecision'] : (string)0;
  352. $account = stringUtil::buildOrderNo(0);
  353. $trainDemo = configDict::getConfig('trainDemo');
  354. $demoName = $trainDemo['merchant']['name'];//培训演示的公众号
  355. if (isset($post['merchantName']) && $post['merchantName'] == $demoName) {
  356. $account = $trainDemo['merchant']['account'];
  357. }
  358. $post['account'] = $account;
  359. $post['adminId'] = 0;
  360. $post['wxToken'] = stringUtil::buildWxToken(0);
  361. $shopPhotoListString = json_encode(["outdoor" => $post['shopImg'], 'indoor' => $post['shopImg2']]);//将门店照片组合成json
  362. $post['shopPhotoList'] = $shopPhotoListString;
  363. $merchant = xhMerchantService::applyCreateMerchant($post);
  364. $id = $merchant['id'];
  365. $account = $merchant['id'];
  366. unset($session['allowGenerateMerchant']);
  367. xhWxMenuService::applyInit($merchant);
  368. $set = xhSetMealService::getRandOne();
  369. $price = $set['price'];
  370. $actPrice = $price;
  371. $mainMerchantId = 0;
  372. $now = time();
  373. $orderDeadline = 0;
  374. if (!empty($inviteCode)) {
  375. $invite = xhInviteService::getByCode($inviteCode);
  376. if (empty($invite)) {
  377. util::failInfo('邀请码不存在');
  378. }
  379. if ($invite['takeStatus'] == 1) {//邀请码未使用,并且没有过期
  380. util::failInfo('邀请码已经使用');
  381. }
  382. $inviteDeadline = $invite['deadline'];
  383. if ($now > $inviteDeadline) {
  384. util::failInfo('邀请码已经过期');
  385. }
  386. $mainMerchantId = isset($invite['merchantId']) ? $invite['merchantId'] : 0;
  387. $actPrice = stringUtil::calcSub($set['price'], $invite['save']);//扣除邀请码里的钱
  388. }
  389. $toPay = $actPrice <= 0 ? 'no' : 'yes';//是否需要付款
  390. $inviteCodeStatus = $actPrice <= 0 ? 1 : 0;//邀请码是否已使用
  391. $payStatus = $actPrice <= 0 ? 1 : 0;//付款是否成功
  392. $createTime = date("Y-m-d H:i:s");
  393. $orderId = 'A' . stringUtil::buildOrderNo($id);
  394. $orderData = ['id' => $orderId, 'userId' => $this->userId, 'applyName' => $merchantName, 'email' => '',
  395. 'createTime' => $createTime, 'accountId' => 0, 'inviteCode' => $inviteCode, 'merchantId' => $mainMerchantId, 'invitedMerchantId' => $id,
  396. 'prePrice' => $price, 'actPrice' => $actPrice, 'deadline' => $orderDeadline, 'inviteCodeStatus' => (int)$inviteCodeStatus, 'payStatus' => $payStatus,
  397. ];
  398. xhApplyOrderService::add($orderData);//保存订单信息
  399. if ($actPrice <= 0 && !empty($inviteCode)) {
  400. xhInviteService::updateByCode($inviteCode, ['targetId' => $orderId, 'takeStatus' => 1, 'invitedMerchantId' => $id, 'inviteUseTo' => 0]);
  401. }
  402. $openMerchant = xhWxOpenService::getMerchant();
  403. $openMerchantAccount = $openmerchant['id'];
  404. $newAccount = urlencode(stringUtil::authcode($account, 'ENCODE', 300));
  405. util::successInfo('提交成功', 'A0001', ['account' => $openMerchantAccount, 'newAccount' => $newAccount, 'toPay' => $toPay, 'orderId' => $orderId, 'actPrice' => $actPrice]);
  406. }
  407. public function actionCheckInviteCode()
  408. {
  409. $get = Yii::$app->request->get();
  410. $code = isset($get['code']) ? $get['code'] : '';
  411. $invite = xhInviteService::getByCode($code);
  412. if (empty($invite)) {
  413. util::failInfo('邀请码错误');
  414. }
  415. $now = time();
  416. if ($now > $invite['deadline']) {
  417. util::failInfo('邀请码已经失效');
  418. }
  419. if (!empty($invite['takeStatus'])) {
  420. util::failInfo('邀请码已经使用');
  421. }
  422. util::successInfo('操作成功', 'A0001', $invite);
  423. }
  424. public function actionSelect()
  425. {
  426. $isWeixin = util::isWeixin();
  427. if ($isWeixin == false) {
  428. return $this->renderPartial('notWeixin');
  429. }
  430. return $this->renderPartial('select');
  431. }
  432. }