|
|
@@ -1,25 +1,27 @@
|
|
|
<?php
|
|
|
-
|
|
|
namespace saas\controllers;
|
|
|
|
|
|
use biz\merchant\services\MerchantService;
|
|
|
-use biz\saas\services\ApplyService;
|
|
|
use common\components\util;
|
|
|
use Yii;
|
|
|
-use yii\web\Controller;
|
|
|
use common\components\wxUtil;
|
|
|
|
|
|
-class ApplyController extends BaseController
|
|
|
+class WxOpenController extends BaseController
|
|
|
{
|
|
|
|
|
|
+ public $withoutLogin = ['bind-open'];
|
|
|
+
|
|
|
public function actionBindOpen()
|
|
|
{
|
|
|
$merchantId = Yii::$app->request->get('merchantId', 0);
|
|
|
$merchant = MerchantService::getMerchantById($merchantId);
|
|
|
+ if (empty($merchant)) {
|
|
|
+ util::fail('没有找到商家');
|
|
|
+ }
|
|
|
$wxAppId = $merchant['wxAppId'];
|
|
|
$miniAppId = $merchant['miniAppId'];
|
|
|
$open_appid = $merchant['openAppId'];
|
|
|
-
|
|
|
+
|
|
|
echo "<pre>";
|
|
|
|
|
|
$id = Yii::$app->request->get('id', 0);
|