Update (post): Sort by publish date
This commit is contained in:
@@ -46,7 +46,7 @@ public function country(Request $request, $country)
|
||||
->where('categories.country_locale_slug', $country_locale->slug)
|
||||
->where('posts.featured', true)
|
||||
->where('posts.status', 'publish')
|
||||
->orderBy('posts.updated_at', 'desc')
|
||||
->orderBy('posts.publish_date', 'desc')
|
||||
->take(3)
|
||||
->get();
|
||||
|
||||
@@ -58,7 +58,7 @@ public function country(Request $request, $country)
|
||||
->where('categories.country_locale_slug', $country_locale->slug)
|
||||
->whereNotIn('posts.id', $featured_posts->pluck('id')->toArray())
|
||||
->where('posts.status', 'publish')
|
||||
->orderBy('posts.updated_at', 'desc')
|
||||
->orderBy('posts.publish_date', 'desc')
|
||||
->distinct()
|
||||
->take(10)
|
||||
->get();
|
||||
@@ -102,7 +102,7 @@ public function countryCategory(Request $request, $country, $category)
|
||||
->where('categories.country_locale_slug', $country_locale->slug)
|
||||
->where('categories.id', $category->id)
|
||||
->where('posts.status', 'publish')
|
||||
->orderBy('posts.updated_at', 'desc')
|
||||
->orderBy('posts.publish_date', 'desc')
|
||||
->distinct()
|
||||
->paginate(15);
|
||||
|
||||
@@ -133,7 +133,7 @@ public function all(Request $request, $country)
|
||||
->whereNotNull('categories.id')
|
||||
->where('categories.country_locale_slug', $country_locale->slug)
|
||||
->where('posts.status', 'publish')
|
||||
->orderBy('posts.updated_at', 'desc')
|
||||
->orderBy('posts.publish_date', 'desc')
|
||||
->distinct()
|
||||
->paginate(15);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user