|
|
@@ -272,28 +272,11 @@ class WxOpenController extends BaseController
|
|
|
|
|
|
$extend = MerchantExtendClass::getByMerchantId($id);
|
|
|
|
|
|
- if (isset($authorize_info['MiniProgramInfo']) && !empty($authorize_info['MiniProgramInfo'])) {
|
|
|
- if (isset($extend['miniAppId']) && !empty($extend['miniAppId'])) {
|
|
|
- if ($extend['miniAppId'] != $authorizeAppId) {
|
|
|
- util::stop('授权的小程序与商家已绑定的小程序不一致');
|
|
|
- }
|
|
|
- } else {
|
|
|
- util::stop('数据库请先填写小程序 miniAppId miniAppSecret');
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (isset($extend['wxAppId']) && !empty($extend['wxAppId'])) {
|
|
|
- if ($extend['wxAppId'] != $authorizeAppId) {
|
|
|
- util::stop('授权的公众号与商家已绑定的公众号不一致');
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
$open = WxOpenService::getOpen();
|
|
|
$time = time();
|
|
|
|
|
|
//小程序
|
|
|
if (isset($authorize_info['MiniProgramInfo']) && !empty($authorize_info['MiniProgramInfo'])) {
|
|
|
-
|
|
|
$miniData = [
|
|
|
'miniAppId' => $authorizeAppId,
|
|
|
'miniAuth' => 1,
|
|
|
@@ -310,6 +293,29 @@ class WxOpenController extends BaseController
|
|
|
WxOpenService::updateOpen(['wx_mini_base_id' => $wxMiniBaseId]);
|
|
|
util::stop('开放平台成功绑定小程序');
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ if (isset($authorize_info['MiniProgramInfo']) && !empty($authorize_info['MiniProgramInfo'])) {
|
|
|
+ if (isset($extend['miniAppId']) && !empty($extend['miniAppId'])) {
|
|
|
+ if ($extend['miniAppId'] != $authorizeAppId) {
|
|
|
+ util::stop('授权的小程序与商家已绑定的小程序不一致');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ util::stop('数据库请先填写小程序 miniAppId miniAppSecret');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (isset($extend['wxAppId']) && !empty($extend['wxAppId'])) {
|
|
|
+ if ($extend['wxAppId'] != $authorizeAppId) {
|
|
|
+ util::stop('授权的公众号与商家已绑定的公众号不一致');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //小程序
|
|
|
+ if (isset($authorize_info['MiniProgramInfo']) && !empty($authorize_info['MiniProgramInfo'])) {
|
|
|
+
|
|
|
+
|
|
|
|
|
|
xhMerchantExtendService::updateByMerchantId($id, $miniData);
|
|
|
MerchantService::updateById($id, ['miniAppId' => $authorizeAppId]);
|