Browse Source

限制只能发布1条公告

master
wanghongjun 2 years ago
parent
commit
a3da53a9b7
  1. 3
      app/controller/Notice.php

3
app/controller/Notice.php

@ -68,6 +68,9 @@ class Notice extends BaseController
} else { } else {
validate(NoticeValidate::class)->scene('add')->check($param); validate(NoticeValidate::class)->scene('add')->check($param);
$queryRes = NoticeModel::where('id','>=',1)->find();
if ($queryRes) throw new ValidateException('限制只能发布1条公告');
$CustomerService = new NoticeModel(); $CustomerService = new NoticeModel();
$CustomerService->save([ $CustomerService->save([
'title' => $param['title'], 'title' => $param['title'],

Loading…
Cancel
Save