|
|
@@ -1,8 +1,10 @@
|
|
|
<?php
|
|
|
+
|
|
|
namespace saas\controllers;
|
|
|
|
|
|
use biz\merchant\services\MerchantExtendService;
|
|
|
use biz\merchant\services\MerchantService;
|
|
|
+use biz\weixin\services\MiniProgramService;
|
|
|
use common\components\util;
|
|
|
use Yii;
|
|
|
use common\components\wxUtil;
|
|
|
@@ -22,7 +24,7 @@ class WxOpenController extends BaseController
|
|
|
$wxAppId = $merchant['wxAppId'];
|
|
|
$miniAppId = $merchant['miniAppId'];
|
|
|
$open_appid = $merchant['openAppId'];
|
|
|
-
|
|
|
+
|
|
|
echo "<pre>";
|
|
|
|
|
|
$id = Yii::$app->request->get('id', 0);
|
|
|
@@ -34,14 +36,14 @@ class WxOpenController extends BaseController
|
|
|
if ($return['errcode'] == 0) {
|
|
|
$openAppId = $return['open_appid'];
|
|
|
MerchantService::updateById($merchantId, ['openAppId' => $openAppId]);
|
|
|
- MerchantExtendService::updateByCondition(['merchantId'=>$merchantId],['openAppId'=>$openAppId,'openAppBind'=>1,'wxAuth'=>1]);
|
|
|
+ MerchantExtendService::updateByCondition(['merchantId' => $merchantId], ['openAppId' => $openAppId, 'openAppBind' => 1, 'wxAuth' => 1]);
|
|
|
}
|
|
|
}
|
|
|
//将小程序绑定到平台
|
|
|
if ($id == 2) {
|
|
|
$openAppId = $merchant['openAppId'];
|
|
|
$r = wxUtil::bindOpenAccount($miniAppId, $openAppId, $merchant, true);
|
|
|
- MerchantExtendService::updateByCondition(['merchantId'=>$merchantId],['openAppBind'=>3,'miniAuth'=>1]);
|
|
|
+ MerchantExtendService::updateByCondition(['merchantId' => $merchantId], ['openAppBind' => 3, 'miniAuth' => 1]);
|
|
|
print_r($r);
|
|
|
}
|
|
|
//查询公众号 小程序的绑定情况
|
|
|
@@ -91,7 +93,7 @@ class WxOpenController extends BaseController
|
|
|
|
|
|
//发布已通过审核的小程序
|
|
|
if ($id == 11) {
|
|
|
- wxUtil::miniRelease($merchant);
|
|
|
+ MiniProgramService::release($merchant);
|
|
|
}
|
|
|
|
|
|
//撤回审核
|
|
|
@@ -142,7 +144,7 @@ class WxOpenController extends BaseController
|
|
|
echo "<br />open_appid:" . $open_appid . "<br />";
|
|
|
if (!empty($open_appid)) {
|
|
|
xhMerchantService::updateById($merchantId, ['openAppId' => $open_appid]);
|
|
|
- MerchantExtendService::updateByCondition(['merchantId'=>$merchantId],['openAppId'=>$open_appid,'openAppBind'=>3,'miniAuth'=>1]);
|
|
|
+ MerchantExtendService::updateByCondition(['merchantId' => $merchantId], ['openAppId' => $open_appid, 'openAppBind' => 3, 'miniAuth' => 1]);
|
|
|
$r = wxUtil::bindOpenAccount($miniAppId, $open_appid, $merchant);
|
|
|
echo "绑定小程序结果:<br />";
|
|
|
print_r($r);
|