优化新增推广员员时手机号错误问题

master
chenzhi 5 years ago
parent 26300062b1
commit c61f750549

@ -233,9 +233,15 @@ class PromoteController extends ThinkController
if ($this->accountExist($account)) {
$this->error('该账号已存在');
}
$res = M('promote', 'tab_')->where(['mobile_phone' => $mobile_phone])->field('id')->find();
if ($res) {
$this->error('该手机号已存在');
if(!empty($mobile_phone)){
//判断手机格式
if (!preg_match("/^1[3456789]{1}\d{9}$/", $mobile_phone)) {
$this->error('手机格式错误');
}
$res = M('promote', 'tab_')->where(['mobile_phone' => $mobile_phone])->field('id')->find();
if ($res) {
$this->error('该手机号已存在');
}
}
$company_belong = $_REQUEST['company_belong'] ?? 0;
$company_relation = $_REQUEST['company_relation'] ?? 0;

Loading…
Cancel
Save