From 53f2e2454c76ed3a0459b6bf96bee73e1a940acd Mon Sep 17 00:00:00 2001 From: hdm Date: Wed, 19 Oct 2022 10:31:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=B7=E5=AE=8C=E5=96=84=E6=96=87=E7=AB=A0?= =?UTF-8?q?=E7=9F=A5=E8=AF=86=E5=86=85=E5=AE=B9=20=E6=8F=90=E9=86=92?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E8=81=94=E7=B3=BB=E4=BA=BA=E4=B8=8D=E8=83=BD=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=A6=96=E8=A6=81=E8=81=94=E7=B3=BB=E4=BA=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/article/view/index/add.html | 2 +- app/article/view/index/edit.html | 2 +- app/customer/controller/Contact.php | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/article/view/index/add.html b/app/article/view/index/add.html index 2887764..e3ffc98 100644 --- a/app/article/view/index/add.html +++ b/app/article/view/index/add.html @@ -122,7 +122,7 @@ form.on('submit(webform)', function (data) { data.field.content = tinyMCE.editors['container'].getContent(); if (data.field.content == '') { - layer.msg('请先完善公告内容'); + layer.msg('请先完善文章只是内容'); return false; } let callback = function (e) { diff --git a/app/article/view/index/edit.html b/app/article/view/index/edit.html index 0deeedb..5c63e48 100644 --- a/app/article/view/index/edit.html +++ b/app/article/view/index/edit.html @@ -125,7 +125,7 @@ const moduleInit = ['tool','tagpicker','tinymce']; form.on('submit(webform)', function (data) { data.field.content = tinyMCE.editors['container'].getContent(); if (data.field.content == '') { - layer.msg('请先完善公告内容'); + layer.msg('请先完善文章只是内容'); return false; } let callback = function (e) { diff --git a/app/customer/controller/Contact.php b/app/customer/controller/Contact.php index b3bc2ac..f744b3e 100644 --- a/app/customer/controller/Contact.php +++ b/app/customer/controller/Contact.php @@ -125,8 +125,11 @@ class Contact extends BaseController { if (request()->isDelete()) { $param = get_params(); - $admin_id = Db::name('CustomerContact')->where(['id' => $param['id']])->value('admin_id'); - if($admin_id != $this->uid){ + $contact = Db::name('CustomerContact')->where(['id' => $param['id']])->find(); + if($contact['is_default'] == 1){ + return to_assign(1, '客户的首要联系人不能删除'); + } + if($contact['admin_id'] != $this->uid){ return to_assign(1, '你不是该联系人的创建人,无权限删除'); } $param['delete_time'] = time();