summaryrefslogtreecommitdiff
path: root/site/app
diff options
context:
space:
mode:
authorhorus2018-02-13 23:00:01 +0100
committerhorus2018-02-13 23:00:01 +0100
commit3c4b69dda4ac9c8a8eee9b568c27cbf23e119209 (patch)
tree82b364704906823093d12ffd5435bd5eee0caa16 /site/app
parent8f81049a6ed85d98fc6a810279a10e824aeb7ac7 (diff)
downloadalkobote-3c4b69dda4ac9c8a8eee9b568c27cbf23e119209.tar.gz
Improves the layout. (website)
Diffstat (limited to 'site/app')
-rw-r--r--site/app/Http/Controllers/PageFeedController.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/site/app/Http/Controllers/PageFeedController.php b/site/app/Http/Controllers/PageFeedController.php
index e29c8ca..ee4f3ec 100644
--- a/site/app/Http/Controllers/PageFeedController.php
+++ b/site/app/Http/Controllers/PageFeedController.php
@@ -15,19 +15,22 @@ class PageFeedController extends Controller {
public function showPage(Request $request) {
- $views = array("whisky", "wodka", "gin", "rum", "misc", "all");
+ $views = array("whisky", "wodka", "gin", "rum", "misc");
$query = "";
foreach($views as $view) {
if ($query != "") {
$query .= " UNION ";
}
- $query .= "(SELECT name, image_url, spirit_type, spirit_type AS url, spirit_type AS feedname, '' AS linktext, created_at FROM ". $view ."_view WHERE original_price > 19.98 ORDER BY created_at DESC LIMIT 1)";
+ $query .= "(SELECT spirit_type as name, image_url, spirit_type, spirit_type AS url, spirit_type AS feedname, '' AS linktext FROM ". $view ."_view WHERE original_price > 19.98 ORDER BY created_at DESC LIMIT 1)";
}
- # todo: schlägt manchmal fehl
- $query .= " UNION (SELECT name, image_url, spirit_type, spirit_type AS url, spirit_type AS feedname, '' AS linktext, created_at FROM ". $view ."_view WHERE original_price > 19.98 AND (procent < (SELECT MAX(procent) FROM all_view)) ORDER BY procent LIMIT 1)";
+
+ # query mit festen parametern
+ $query .= " UNION (SELECT 'Alle Angebote' as name, '/img/paw-400-400.png' as image_url, 'Alle Angebote' as spirit_type, 'all' AS url, 'Feed aller Angebote' AS feedname, 'Zum Feed aller Angebote' AS linktext FROM all_view LIMIT 1)";
$data = DB::select($query);
+
+ array_push($views, "alle angebote");
return view('feeds', ['data' => $data, 'views' => $views]);
}