Commit 7bfc92f3 by gongyang

提交代码

parent f91e80ae
Showing with 5 additions and 0 deletions
...@@ -460,6 +460,11 @@ class SystemNoticeLogic ...@@ -460,6 +460,11 @@ class SystemNoticeLogic
public function topBusinessNotice($requestData) public function topBusinessNotice($requestData)
{ {
$idArr = explode(',',$requestData['business_notice_id']); $idArr = explode(',',$requestData['business_notice_id']);
if($requestData['top_status']){
if (BusinessNoticeModel::where('top_status',1)->count('business_notice_id') >= 5){
throw new \Exception('当前全系统置顶已满5条,暂时无法置顶新公告,请先取消一条现有置顶 !');
}
}
(new BusinessNoticeModel())->where('business_notice_id',$idArr)->update(['top_status'=>$requestData['top_status']]); (new BusinessNoticeModel())->where('business_notice_id',$idArr)->update(['top_status'=>$requestData['top_status']]);
return []; return [];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment