瀏覽代碼

小程序提交

shish 6 年之前
父節點
當前提交
7f40c7a4d5
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      app/saas/controllers/MerchantController.php

+ 5 - 5
app/saas/controllers/MerchantController.php

@@ -46,8 +46,8 @@ class MerchantController extends BaseController
 	
 	public function actionBindOpen()
 	{
-		$account = Yii::$app->request->get('account', 0);
-		$merchant = MerchantService::getById($account);
+		$merchantId = Yii::$app->request->get('account', 0);
+		$merchant = MerchantService::getById($merchantId);
 		if (empty($merchant)) {
 			util::fail('没有找到商家');
 		}
@@ -56,7 +56,7 @@ class MerchantController extends BaseController
 		$openAppId = $merchant['openAppId'];
 		
 		echo "<pre>";
-		
+
 		$id = Yii::$app->request->get('id', 0);
 		//创建平台,并将公众号绑定到平台
 		if ($id == 1) {
@@ -65,7 +65,7 @@ class MerchantController extends BaseController
 			print_r($return);
 			if ($return['errcode'] == 0) {
 				$openAppId = $return['open_appid'];
-				xhMerchantService::updateById($this->merchantId, ['openAppId' => $openAppId]);
+				xhMerchantService::updateById($merchantId, ['openAppId' => $openAppId]);
 			}
 		}
 		//将小程序绑定到平台
@@ -171,7 +171,7 @@ class MerchantController extends BaseController
 		}
 		echo "<br />openAppId:" . $openAppId . "<br />";
 		if (!empty($openAppId)) {
-			xhMerchantService::updateById($this->merchantId, ['openAppId' => $openAppId]);
+			xhMerchantService::updateById($merchantId, ['openAppId' => $openAppId]);
 			$r = wxUtil::bindOpenAccount($miniAppId, $openAppId, $merchant);
 			echo "绑定小程序结果:<br />";
 			print_r($r);