From a3da53a9b708db1d0ce6094aa810ff638de23be0 Mon Sep 17 00:00:00 2001 From: wanghongjun <1445693971@qq,com> Date: Tue, 19 Sep 2023 09:58:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=90=E5=88=B6=E5=8F=AA=E8=83=BD=E5=8F=91?= =?UTF-8?q?=E5=B8=831=E6=9D=A1=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/Notice.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controller/Notice.php b/app/controller/Notice.php index c7f0afb..d557e9c 100644 --- a/app/controller/Notice.php +++ b/app/controller/Notice.php @@ -68,6 +68,9 @@ class Notice extends BaseController } else { validate(NoticeValidate::class)->scene('add')->check($param); + $queryRes = NoticeModel::where('id','>=',1)->find(); + if ($queryRes) throw new ValidateException('限制只能发布1条公告'); + $CustomerService = new NoticeModel(); $CustomerService->save([ 'title' => $param['title'],