checkBindPhone($this->userId); $wxPhone = $this->jsCodeGetPhoneNumber($this->request->input('js_code')); if (empty($wxPhone['phone_info']['purePhoneNumber'])) throw new ErrException('微信手机号查询失败,请联系人工客服处理'); $userInfo = $this->getUserInfo($this->userId); $userInfo->mobile = $wxPhone['phone_info']['purePhoneNumber']; if (!$userInfo->save()) throw new ErrException('绑定手机号失败,请联系人工客服处理'); return $this->return->success(); } }