浏览代码

判断条件修改

duqinya 5 年之前
父节点
当前提交
5a6c2098f5
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/Repositories/StarNewsRepository.php

+ 1 - 1
app/Repositories/StarNewsRepository.php

@@ -65,7 +65,7 @@ class StarNewsRepository
         $starNew->updated_at = date('Y-m-d H:i:s');
 
         $open_news = $this->starNews->where('status',1)->count();
-        if ($open_news >= 5 && $request['status'] == 1){
+        if ($open_news > 5 && $request['status'] == 1){
             throw new HttpException(500, '最多开启5条新闻');
         }
         $res = $starNew->save();