|
|
@@ -5,6 +5,7 @@ namespace console\controllers;
|
|
|
use biz\goods\services\GoodsCategoryService;
|
|
|
use biz\goods\services\GoodsService;
|
|
|
use biz\goods\services\GoodsStyleService;
|
|
|
+use biz\merchant\classes\MerchantClass;
|
|
|
use biz\merchant\services\MerchantCapitalService;
|
|
|
use biz\merchant\services\MerchantExtendService;
|
|
|
use biz\merchant\services\MerchantService;
|
|
|
@@ -19,6 +20,7 @@ use biz\user\services\UserAssetService;
|
|
|
use biz\user\services\UserCapitalService;
|
|
|
use biz\user\services\UserGrowthService;
|
|
|
use biz\user\services\UserService;
|
|
|
+use biz\weixin\classes\WxAccountClass;
|
|
|
use biz\weixin\services\WxMenuService;
|
|
|
use common\components\dirUtil;
|
|
|
use common\components\util;
|
|
|
@@ -1343,8 +1345,21 @@ ALTER TABLE xhMerchant MODIFY `logo` VARCHAR(500) NOT NULL DEFAULT '' COMMENT '
|
|
|
{
|
|
|
$merchant = MerchantService::getMerchantById($id);
|
|
|
$appId = $merchant['wxAppId'];
|
|
|
- $info = wxUtil::getAuthorizerInfo($appId);
|
|
|
- print_r($info);
|
|
|
+ $respond = wxUtil::getAuthorizerInfo($appId);
|
|
|
+ $update = [];
|
|
|
+ if (isset($respond['authorizer_info']['head_img']) && !empty($respond['authorizer_info']['head_img'])) {
|
|
|
+ $imgUrl = $respond['authorizer_info']['head_img'];
|
|
|
+ $returnImg = WxAccountClass::saveLogo($imgUrl, $id);
|
|
|
+ $update['logo'] = $returnImg;
|
|
|
+ }
|
|
|
+ if (isset($respond['authorizer_info']['qrcode_url']) && !empty($respond['authorizer_info']['qrcode_url'])) {
|
|
|
+ $qrCodeUrl = $respond['authorizer_info']['qrcode_url'];
|
|
|
+ $returnImg = WxAccountClass::saveQrCode($qrCodeUrl, $id);
|
|
|
+ $update['wxQrCodeUrl'] = $returnImg;
|
|
|
+ }
|
|
|
+ if (!emtpy($update)) {
|
|
|
+ MerchantClass::updateByCondition(['merchantId' => $id], $update);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|