From b3d604d3d8b4d0d77abfd18fab90844f3e16b4d1 Mon Sep 17 00:00:00 2001 From: hdm Date: Sun, 25 Sep 2022 12:41:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=A2=E6=88=B7=E8=81=94?= =?UTF-8?q?=E7=B3=BB=E4=BA=BA=E6=97=B6=E5=A6=82=E6=9E=9C=E8=BF=98=E6=B2=A1?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84=E8=AE=BE=E4=B8=BA=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=81=94=E7=B3=BB=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/customer/controller/Contact.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/customer/controller/Contact.php b/app/customer/controller/Contact.php index e29c046..ec8ce69 100644 --- a/app/customer/controller/Contact.php +++ b/app/customer/controller/Contact.php @@ -85,6 +85,10 @@ class Contact extends BaseController // 验证失败 输出错误信息 return to_assign(1, $e->getError()); } + $count= Db::name('CustomerContact')->where(['cid' => $param['cid'],'delete_time' => 0])->count(); + if($count == 0){ + $param['is_default'] = 1; + } $param['admin_id'] = $this->uid; $param['create_time'] = time(); $insertId = Db::name('CustomerContact')->strict(false)->field(true)->insertGetId($param);