REFACTORING #1880 @4h30m: another ugly refactoring commit
This commit is contained in:
@@ -96,18 +96,18 @@ class ArticleList extends Handler
|
||||
*/
|
||||
public function render(Content $content, $parameters)
|
||||
{
|
||||
$articles = ArticleModel::where('module_handler', Article::class)
|
||||
$articles = ArticleModel::where('moduleHandler', Article::class)
|
||||
->with('comments')
|
||||
->with('category')
|
||||
->where(function ($query) {
|
||||
$query->where('published_from', '<', Carbon::now())
|
||||
->orWhereNull('published_from');
|
||||
$query->where('publishedFrom', '<', Carbon::now())
|
||||
->orWhereNull('publishedFrom');
|
||||
})
|
||||
->where(function ($query) {
|
||||
$query->where('published_to', '>', Carbon::now())
|
||||
->orWhereNull('published_to');
|
||||
$query->where('publishedTo', '>', Carbon::now())
|
||||
->orWhereNull('publishedTo');
|
||||
})
|
||||
->orderBy('published_from', 'DESC')
|
||||
->orderBy('publishedFrom', 'DESC')
|
||||
->orderBy('created_at', 'DESC');
|
||||
|
||||
// show articles for not-logged users of even for logged onew?
|
||||
@@ -135,7 +135,7 @@ class ArticleList extends Handler
|
||||
|
||||
// decode module settings
|
||||
foreach ($articles as $article) {
|
||||
$article->module_settings = json_decode($article->module_settings);
|
||||
$article->moduleSettings = json_decode($article->moduleSettings);
|
||||
}
|
||||
|
||||
return Controller::VisitorsView($content->template, [
|
||||
|
||||
Reference in New Issue
Block a user