messages implemented
This commit is contained in:
@@ -15,11 +15,11 @@ class TopFavouritesController extends Controller
|
||||
$hits = 21;
|
||||
$page = max(1, (int) $request->query('page', 1));
|
||||
|
||||
$base = DB::table('artworks_favourites as t1')
|
||||
->rightJoin('wallz as t2', 't1.artwork_id', '=', 't2.id')
|
||||
->where('t2.approved', 1)
|
||||
->select('t2.id', 't2.name', 't2.picture', 't2.category', DB::raw('COUNT(*) as num'))
|
||||
->groupBy('t1.artwork_id');
|
||||
$base = DB::table('artwork_favourites as t1')
|
||||
->join('artworks as t2', 't1.artwork_id', '=', 't2.id')
|
||||
->whereNotNull('t2.published_at')
|
||||
->select('t2.id', 't2.title as name', 't2.slug', DB::raw('NULL as picture'), DB::raw('NULL as category'), DB::raw('COUNT(*) as num'))
|
||||
->groupBy('t2.id', 't2.title', 't2.slug');
|
||||
|
||||
try {
|
||||
$paginator = (clone $base)->orderBy('num', 'desc')->paginate($hits)->withQueryString();
|
||||
|
||||
Reference in New Issue
Block a user