wesmiler 2 yıl önce
ebeveyn
işleme
36c6e9dff8
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  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() : [];