From 1b1e163c4f94c0a8852692dcb3c70a4d08135ff3 Mon Sep 17 00:00:00 2001 From: horus Date: Wed, 21 Feb 2018 23:34:08 +0100 Subject: Adds link to rss feed on index page. (website) --- site/app/Http/Controllers/IndexController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'site/app') diff --git a/site/app/Http/Controllers/IndexController.php b/site/app/Http/Controllers/IndexController.php index b82d2cd..9023ac2 100644 --- a/site/app/Http/Controllers/IndexController.php +++ b/site/app/Http/Controllers/IndexController.php @@ -23,14 +23,17 @@ class IndexController extends Controller { $query .= " UNION "; } # subquery to get procent, because cheap spirits don't look good - $query .= "(SELECT name, image_url, spirit_type, spirit_type AS url, spirit_type AS angebotsname, original_price, discounted_price, (SELECT MAX(procent) FROM " . $view . "_view) as procent, '' AS linktext FROM ". $view ."_view WHERE original_price > 19.98 ORDER BY procent DESC LIMIT 1)"; + $query .= "(SELECT name, image_url, spirit_type, spirit_type AS url, spirit_type AS angebotsname, (SELECT MAX(procent) FROM " . $view . "_view) as procent, '' AS linktext FROM ". $view ."_view WHERE original_price > 19.98 ORDER BY procent DESC LIMIT 1)"; } + $query .= " UNION (SELECT 'Alle Angebote' as name, '/img/paw-400-400.png' as image_url, 'RSS-Feeds' as spirit_type, 'feeds' AS url, 'RSS-Feeds' AS angebotsname, (SELECT MAX(procent) FROM all_view) as procent, 'Zu den RSS-Feeds' AS linktext FROM all_view LIMIT 1)"; $data = DB::select($query); $count = DB::select("SELECT count(*) as count FROM all_view")[0]; #$data = DB::table('whisky_view')->orderBy('procent', 'DESC')->limit(100)->simplePaginate(20); + #$views[] = "rss-feeds"; + return view('index', ['data' => $data, 'views' => $views, 'hits' => $count]); } } -- cgit v1.2.3