FIX: fix published_from and published_to
This commit is contained in:
@@ -66,11 +66,11 @@ class Content extends Model
|
|||||||
->with('author')
|
->with('author')
|
||||||
->join('modules', 'modules.handler', '=', 'contents.module_handler')
|
->join('modules', 'modules.handler', '=', 'contents.module_handler')
|
||||||
->where(function ($query) {
|
->where(function ($query) {
|
||||||
$query->where('published_from', '>', Carbon::now())
|
$query->where('published_from', '<', Carbon::now())
|
||||||
->orWhereNull('published_from');
|
->orWhereNull('published_from');
|
||||||
})
|
})
|
||||||
->where(function ($query) {
|
->where(function ($query) {
|
||||||
$query->where('published_to', '<', Carbon::now())
|
$query->where('published_to', '>', Carbon::now())
|
||||||
->orWhereNull('published_to');
|
->orWhereNull('published_to');
|
||||||
})
|
})
|
||||||
->where('language', LaravelLocalization::getCurrentLocale())
|
->where('language', LaravelLocalization::getCurrentLocale())
|
||||||
|
|||||||
@@ -100,11 +100,11 @@ class ArticleList extends Handler
|
|||||||
->with('comments')
|
->with('comments')
|
||||||
->with('category')
|
->with('category')
|
||||||
->where(function ($query) {
|
->where(function ($query) {
|
||||||
$query->where('published_from', '>', Carbon::now())
|
$query->where('published_from', '<', Carbon::now())
|
||||||
->orWhereNull('published_from');
|
->orWhereNull('published_from');
|
||||||
})
|
})
|
||||||
->where(function ($query) {
|
->where(function ($query) {
|
||||||
$query->where('published_to', '<', Carbon::now())
|
$query->where('published_to', '>', Carbon::now())
|
||||||
->orWhereNull('published_to');
|
->orWhereNull('published_to');
|
||||||
})
|
})
|
||||||
->orderBy('published_from', 'DESC')
|
->orderBy('published_from', 'DESC')
|
||||||
|
|||||||
Reference in New Issue
Block a user