| | |
| | | use app\api\logic\SettlementRecord as LogicSettlementRecord; |
| | | use app\api\logic\UserMoneyLog as LogicUserMoneyLog; |
| | | use think\log; |
| | | use app\api\logic\ActivityInfo as InfoActivityInfo; |
| | | use app\common\model\UserExtend as ModelUserExtend; |
| | | use think\Db; |
| | | |
| | | /** |
| | | * 会员接口 |
| | |
| | | $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'); |
| | |
| | | $this->error('绑定失败'); |
| | | } |
| | | $ModelUser->commit(); |
| | | //更新招募活动信息 |
| | | $activityInfo=new InfoActivityInfo(); |
| | | $activityInfo->updateRecruitCount($save_data['invitation_id'] ); |
| | | $this->success('绑定成功',[]); |
| | | } |
| | | |
| | |
| | | $this->success('获取成功',$user); |
| | | } |
| | | |
| | | /** |
| | | * 检测是否有偏好商品 |
| | | * |
| | | * @return void |
| | | */ |
| | | |
| | | public function check_preference_goods() |
| | | { |
| | | //获取当前登录人用户信息 |
| | | $user = $this->auth->getUser(); |
| | | $ModelUserExtend=new ModelUserExtend(); |
| | | $preference_goods=$ModelUserExtend->where(['id'=>$user['id']])->field('p_cids,p_platefrom')->find(); |
| | | if(empty($preference_goods)||empty($preference_goods['p_cids'])) $this->error('暂无偏好商品'); |
| | | $this->success('获取成功',$preference_goods); |
| | | } |
| | | |
| | | } |