作者 何书鹏
1 个管道 的构建 通过 耗费 0 秒

手机号格式验证

@@ -18,6 +18,7 @@ use think\Db; @@ -18,6 +18,7 @@ use think\Db;
18 use think\Exception; 18 use think\Exception;
19 use think\exception\PDOException; 19 use think\exception\PDOException;
20 use EasyWeChat\Kernel\Exceptions\InvalidConfigException; 20 use EasyWeChat\Kernel\Exceptions\InvalidConfigException;
  21 +use think\Validate;
21 22
22 /** 23 /**
23 * 会员接口 24 * 会员接口
@@ -744,6 +745,7 @@ class User extends Api @@ -744,6 +745,7 @@ class User extends Api
744 empty($post['idcard_front']) && $this->error('请上传身份证正面'); 745 empty($post['idcard_front']) && $this->error('请上传身份证正面');
745 empty($post['idcard_back']) && $this->error('请上传身份证反面'); 746 empty($post['idcard_back']) && $this->error('请上传身份证反面');
746 empty($post['certificates']) && $this->error('请上传从医资格证'); 747 empty($post['certificates']) && $this->error('请上传从医资格证');
  748 + !Validate::regex($post['mobile'], '/^1\d{10}$/') && $this->error('联系电话格式不正确');
747 $doctor = Doctor::where('user_id',$this->auth->id)->find(); 749 $doctor = Doctor::where('user_id',$this->auth->id)->find();
748 $doctor['status'] == '1' && $this->error('已通过审核'); 750 $doctor['status'] == '1' && $this->error('已通过审核');
749 if(!$doctor){ 751 if(!$doctor){