| | |
| | | use app\api\logic\SettlementRecord as LogicSettlementRecord; |
| | | use app\api\logic\UserMoneyLog as LogicUserMoneyLog; |
| | | use think\log; |
| | | use app\api\logic\ActivityInfo as InfoActivityInfo; |
| | | |
| | | /** |
| | | * 会员接口 |
| | |
| | | $mobile = $this->request->post('mobile'); |
| | | $captcha = $this->request->post('captcha'); |
| | | $ismobouth=$this->request->post('ismobouth',false); |
| | | $push_cid=$this->request->post('push_cid',false); |
| | | $pushCid=$this->request->post('pushCid',false); |
| | | if (!$mobile || !$captcha) { |
| | | $this->error(__('Invalid parameters')); |
| | | } |
| | |
| | | //如果已经有账号则直接登录 |
| | | $ret = $this->auth->direct($user->id); |
| | | } else { |
| | | $ret = $this->auth->register($mobile, Random::alnum(), '', $mobile, []); |
| | | $ret = $this->auth->register($mobile, Random::alnum(), '', $mobile, [],'',[],$pushCid); |
| | | } |
| | | if ($ret) { |
| | | Sms::flush($mobile, 'login'); |
| | |
| | | public function bind_mobile_login() |
| | | { |
| | | $wxUser = request()->param('wxUser','','urldecode'); |
| | | $pushCid= request()->param('pushCid',''); |
| | | $wxUser = json_decode($wxUser,true); |
| | | if(empty($wxUser)) $this->error('微信授权信息获取失败'); |
| | | $mobile = $this->request->post('mobile'); |
| | |
| | | $is_phone_bind = $ModelUser->where(['mobile'=> $mobile])->find(); |
| | | if(!empty($is_phone_bind)){ |
| | | $LogicUser->bindWechat($is_phone_bind['id'],$wxUser['headimgurl'],$wxUser['sex'],$wxUser['nickname'],$wxUser['openid']); |
| | | $ret = $this->auth->direct($is_phone_bind['id']); |
| | | $ret = $this->auth->direct($is_phone_bind['id'],$pushCid); |
| | | }else{ //判断微信是否已经绑定 |
| | | $find_third = $ModelThird->where(['openid'=>$wxUser['openid']])->find(); |
| | | if(!empty($find_third)) $this->error('当前微信号已绑定其他账号'); |
| | | $ret = $this->auth->register('', Random::alnum(), '', $mobile, [],'wechat',$wxUser); |
| | | $ret = $this->auth->register('', Random::alnum(), '', $mobile, [],'wechat',$wxUser,$pushCid); |
| | | } |
| | | Sms::flush($mobile, 'changemobile'); |
| | | if ($ret) { |
| | |
| | | $this->error('绑定失败'); |
| | | } |
| | | $ModelUser->commit(); |
| | | //更新招募活动信息 |
| | | $activityInfo=new InfoActivityInfo(); |
| | | $activityInfo->updateRecruitCount($save_data['invitation_id'] ); |
| | | $this->success('绑定成功',[]); |
| | | } |
| | | |