소스 검색

判断条件修改

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');
         $starNew->updated_at = date('Y-m-d H:i:s');
 
 
         $open_news = $this->starNews->where('status',1)->count();
         $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条新闻');
             throw new HttpException(500, '最多开启5条新闻');
         }
         }
         $res = $starNew->save();
         $res = $starNew->save();