wesmiler 2 лет назад
Родитель
Сommit
36c6e9dff8
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      app/Services/Api/ArticleService.php

+ 3 - 1
app/Services/Api/ArticleService.php

@@ -172,7 +172,9 @@ class ArticleService extends BaseService
         }
 
         $info = $this->model->where(['id'=> $id,'status'=>1,'mark'=>1])
-            ->where('publish_at','<=', date('Y-m-d H:i:s'))
+            ->where(function($query) {
+                $query->where('publish_at','<=', date('Y-m-d H:i:s'))->orWhereNull('publish_at');
+            })
             ->select($field)
             ->first();
         $info = $info? $info->toArray() : [];