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'],