FIX: fix published_from and published_to
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user