shish 6 роки тому
батько
коміт
6d6b0f9e69
1 змінених файлів з 8 додано та 8 видалено
  1. 8 8
      app/saas/controllers/UserController.php

+ 8 - 8
app/saas/controllers/UserController.php

@@ -82,21 +82,21 @@ class UserController extends BaseController
 		$id = Yii::$app->request->get('id');
 		$shop = ShopService::getById($id);
 		$merchantId = isset($shop['merchantId']) ? $shop['merchantId'] : 0;
-		$extend = MerchantExtendService::getByMerchantId($merchantId);
-		if (empty($extend)) {
+		if (empty($merchantId)) {
 			util::fail('没有找到商家');
 		}
-		$applyMemberCode = isset($extend['applyMemberCode']) ? $extend['applyMemberCode'] : '';
-		$file = dirUtil::getImgDir() . $applyMemberCode;
-		if (empty($applyMemberCode) || file_exists($file) == false) {
+		$gatheringCode = isset($shop['gatheringCode']) ? $shop['gatheringCode'] : '';
+		$file = dirUtil::getImgDir() . $gatheringCode;
+		if (empty($gatheringCode) || file_exists($file) == false) {
 			$url = Yii::$app->params['mDomain'] . "/#/pages/pay/index?account={$merchantId}&shopId=" . $id;
 			//强制转成https
 			$url = httpUtil::becomeHttps($url);
-			$applyMemberCode = qrCodeUtil::generateGatheringQrCode($url, $merchantId, $id, '', 10);
+			$gatheringCode = qrCodeUtil::generateGatheringQrCode($url, $merchantId, $id, '', 10);
+			ShopService::updateById($id, ['gatheringCode' => $gatheringCode]);
 		}
-		$imgUrl = Yii::$app->params['imgHost'] . $applyMemberCode;
+		$imgUrl = Yii::$app->params['imgHost'] . $gatheringCode;
 		echo '<br /><br />收款码<br /><br />';
 		echo "<img width='300' src='{$imgUrl}' />";
 	}
-	
+
 }