summaryrefslogtreecommitdiff
path: root/site/app
diff options
context:
space:
mode:
Diffstat (limited to 'site/app')
-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]);
}
}