diff --git a/app/Models/Content.php b/app/Models/Content.php index 1723966d..2c793c37 100644 --- a/app/Models/Content.php +++ b/app/Models/Content.php @@ -66,11 +66,11 @@ class Content extends Model ->with('author') ->join('modules', 'modules.handler', '=', 'contents.module_handler') ->where(function ($query) { - $query->where('published_from', '>', Carbon::now()) + $query->where('published_from', '<', Carbon::now()) ->orWhereNull('published_from'); }) ->where(function ($query) { - $query->where('published_to', '<', Carbon::now()) + $query->where('published_to', '>', Carbon::now()) ->orWhereNull('published_to'); }) ->where('language', LaravelLocalization::getCurrentLocale()) diff --git a/modules/Blog/ArticleList/Handlers/ArticleList.php b/modules/Blog/ArticleList/Handlers/ArticleList.php index 39838d4c..275e16d2 100644 --- a/modules/Blog/ArticleList/Handlers/ArticleList.php +++ b/modules/Blog/ArticleList/Handlers/ArticleList.php @@ -100,11 +100,11 @@ class ArticleList extends Handler ->with('comments') ->with('category') ->where(function ($query) { - $query->where('published_from', '>', Carbon::now()) + $query->where('published_from', '<', Carbon::now()) ->orWhereNull('published_from'); }) ->where(function ($query) { - $query->where('published_to', '<', Carbon::now()) + $query->where('published_to', '>', Carbon::now()) ->orWhereNull('published_to'); }) ->orderBy('published_from', 'DESC')