From c2b316547391397cb9fcca788282d3006da14910 Mon Sep 17 00:00:00 2001 From: lccsw <1127794702@qq.com> Date: Thu, 6 Jan 2022 10:53:38 +0800 Subject: [PATCH] edit-api-edit-customer --- api/controllers/wxapp/licheb/Customers.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/api/controllers/wxapp/licheb/Customers.php b/api/controllers/wxapp/licheb/Customers.php index e562e4b5..b53f96ea 100644 --- a/api/controllers/wxapp/licheb/Customers.php +++ b/api/controllers/wxapp/licheb/Customers.php @@ -120,14 +120,16 @@ class Customers extends Wxapp } $car_json = json_decode($row['car_json'], true); $update = []; - if ($mobile) { - if (!mobile_valid($mobile)) { - throw new Exception('手机号格式错误', ERR_PARAMS_ERROR); + if($row['cf_title']!='平台分配'){ + if ($mobile) { + if (!mobile_valid($mobile)) { + throw new Exception('手机号格式错误', ERR_PARAMS_ERROR); + } + if ($this->customers_model->count(['biz_id' => $biz_id, 'mobile' => $mobile])) { + throw new Exception('客户已存在', API_CODE_FAIL); + } + $update['mobile'] = $mobile; } - if ($this->customers_model->count(['biz_id' => $biz_id, 'mobile' => $mobile])) { - throw new Exception('客户已存在', API_CODE_FAIL); - } - $update['mobile'] = $mobile; } $s_row = $this->auto_series_model->get(['id' => $car_id]); $ids_arr = [];