Browse Source

关注用户的id

shish 5 years ago
parent
commit
cec34c555c
1 changed files with 3 additions and 1 deletions
  1. 3 1
      app-pt/controllers/WxController.php

+ 3 - 1
app-pt/controllers/WxController.php

@@ -127,12 +127,14 @@ class WxController extends PublicController
                         $getUserInfo = wxUtil::userInfo($this->fromUsername, $merchant, 1);
                         $source = UserClass::$userSourceId['official']['name'];
                         $getUserInfo['subscribe'] = 1;
-                        AdminService::replaceAdmin($getUserInfo, $source);
+                        $respond = AdminService::replaceAdmin($getUserInfo, $source);
                         $text = $this->replyTextContent("等您好久,终于等到您 /::)");
                         $pc = new \WXBizMsgCrypt($openToken, $encodingAesKey, $openAppId);
                         $encryptMsg = '';
                         $pc->encryptMsg($text, $timestamp, $nonce, $encryptMsg);//加密
                         echo $encryptMsg;
+                        $currentId = $respond['id'] ?? 0;
+                        Yii::info("关注用户的ID:{$currentId}");
                         break;
                     //取消关注
                     case 'unsubscribe':