|
|
@@ -3,6 +3,8 @@
|
|
|
namespace pt\controllers;
|
|
|
|
|
|
use biz\sj\services\MerchantService;
|
|
|
+use biz\wx\classes\WxGzhClass;
|
|
|
+use biz\wx\classes\WxMiniClass;
|
|
|
use common\components\util;
|
|
|
use Yii;
|
|
|
use common\components\wxUtil;
|
|
|
@@ -44,9 +46,17 @@ class WxOpenController extends PublicController
|
|
|
//1 只显示公众号 2 只显示小程序 3 显示公众号和小程序
|
|
|
$authType = Yii::$app->request->get('authType', 3);
|
|
|
if ($authType == 1) {
|
|
|
- $wxBaseId = $open['wxBaseId'] ?? 0;
|
|
|
+ $wxId = $open['wxBaseId'] ?? 0;
|
|
|
+ $wxInfo = WxGzhClass::getById($wxId);
|
|
|
+ if (isset($wxInfo['auth']) && $wxInfo['auth'] == 2) {
|
|
|
+ util::stop('已经授权过了,如需重新授权,请修改xhWxGzh auth字段');
|
|
|
+ }
|
|
|
} elseif ($authType == 2) {
|
|
|
- $wxMiniBaseId = $open['wxMiniBaseId'] ?? 0;
|
|
|
+ $wxId = $open['wxMiniBaseId'] ?? 0;
|
|
|
+ $wxInfo = WxMiniClass::getById($wxId);
|
|
|
+ if (isset($wxInfo['auth']) && $wxInfo['auth'] == 2) {
|
|
|
+ util::stop('已经授权过了,如需重新授权,请修改xhWxMini auth字段');
|
|
|
+ }
|
|
|
} elseif ($authType == 3) {
|
|
|
util::stop('既显示公众号和小程序,这个通道应该关闭');
|
|
|
}
|