zhaojs
2023-06-29 c6aed7b39a4e95a25e5bcac47a55ac98cb222b49
application/api/controller/User.php
@@ -18,6 +18,8 @@
use app\api\logic\UserWithdrawal as LogicUserWithdrawal;
use app\api\logic\SettlementRecord as LogicSettlementRecord;
use app\api\logic\UserMoneyLog as LogicUserMoneyLog;
use think\log;
/**
 * 会员接口
 */
@@ -84,6 +86,7 @@
        $mobile = $this->request->post('mobile');
        $captcha = $this->request->post('captcha');
        $ismobouth=$this->request->post('ismobouth',false);
        $push_cid=$this->request->post('push_cid',false);
        if (!$mobile || !$captcha) {
            $this->error(__('Invalid parameters'));
        }
@@ -211,7 +214,8 @@
        $user = $this->auth->getUser();
        $mobile = $this->request->post('mobile');
        $captcha = $this->request->post('captcha');
        if (!$mobile || !$captcha) {
        $isyj=$this->request->post('isyj',false);
        if (!$mobile || (!$isyj&&!$captcha)) {
            $this->error(__('Invalid parameters'));
        }
        if (!Validate::regex($mobile, "^1\d{10}$")) {
@@ -282,16 +286,21 @@
        if(empty($wxUser)) $this->error('微信授权信息获取失败');
        $mobile = $this->request->post('mobile');
        $captcha = $this->request->post('captcha');
        if (!$mobile || !$captcha) {
        $isyj=$this->request->post('isyj',false);
        if (!$mobile || (!$isyj&&!$captcha)) {
            $this->error(__('Invalid parameters'));
        }
        if (!Validate::regex($mobile, "^1\d{10}$")) {
            $this->error('请输入正确手机号');
        }
        $result = Sms::check($mobile, $captcha, 'changemobile');
        if (!$result) {
            $this->error(__('Captcha is incorrect'));
        if(!$isyj)
        {
            $result = Sms::check($mobile, $captcha, 'changemobile');
            if (!$result) {
                $this->error(__('Captcha is incorrect'));
            }
        }
        $ModelThird = new ModelThird();
        $LogicUser = new LogicUser();
        //判断当前手机号是否已经绑定微信
@@ -465,7 +474,7 @@
        $res = $LogicUserBrowse->checkIsFirstFree(USERID);
        if($res === false) $this->error($LogicUserBrowse->getError());
        Log::write('检测是否首单:'.json_encode($res));
        if(empty($res)) $this->success(['info'=>1],'首单客户');
        $this->success(['info'=>0],'非首单客户');
    }