Browse Source

判断条件修改

duqinya 5 years ago
parent
commit
5a6c2098f5
1 changed files with 1 additions and 1 deletions
  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();