summaryrefslogtreecommitdiff
path: root/site/app/Http/Controllers/IndexController.php
diff options
context:
space:
mode:
authorhorus2018-02-21 23:34:08 +0100
committerhorus2018-02-21 23:34:08 +0100
commit1b1e163c4f94c0a8852692dcb3c70a4d08135ff3 (patch)
tree6715a7de4e276f360ea4a013f3f3ba70ccd78697 /site/app/Http/Controllers/IndexController.php
parent73634fea62cac6e50803e27df5848c72b6dc30fa (diff)
downloadalkobote-1b1e163c4f94c0a8852692dcb3c70a4d08135ff3.tar.gz
Adds link to rss feed on index page. (website)
Diffstat (limited to 'site/app/Http/Controllers/IndexController.php')
-rw-r--r--site/app/Http/Controllers/IndexController.php5
1 files changed, 4 insertions, 1 deletions
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]);
}
}