From c61f750549f8157887cbeb008362a03590a20696 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 12 Mar 2020 14:58:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=B0=E5=A2=9E=E6=8E=A8?= =?UTF-8?q?=E5=B9=BF=E5=91=98=E5=91=98=E6=97=B6=E6=89=8B=E6=9C=BA=E5=8F=B7?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Controller/PromoteController.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Application/Admin/Controller/PromoteController.class.php b/Application/Admin/Controller/PromoteController.class.php index c5e1fc945..79da46dd1 100644 --- a/Application/Admin/Controller/PromoteController.class.php +++ b/Application/Admin/Controller/PromoteController.class.php @@ -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;