From a6990d16e4efb813188d2f406ae7dd74fd0f9bb1 Mon Sep 17 00:00:00 2001 From: Kekskurse Date: Tue, 12 Jan 2021 19:05:03 +0100 Subject: [PATCH] Stuff --- .gitignore | 1 + app/Console/Commands/CalculateSpace.php | 2 +- app/Models/Traffic.php | 2 +- docs/setup-server.md | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 0ae59f0..1de3d48 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ Homestead.json Homestead.yaml npm-debug.log yarn-error.log +storage/cache diff --git a/app/Console/Commands/CalculateSpace.php b/app/Console/Commands/CalculateSpace.php index 422aa9b..60abeac 100644 --- a/app/Console/Commands/CalculateSpace.php +++ b/app/Console/Commands/CalculateSpace.php @@ -44,7 +44,7 @@ class CalculateSpace extends Command $day = date("Y-m-d"); $day = "2021-01-11"; $galleries = Gallery::query()->get(); - for ($i = 0; $i <= 24; $i++) { + for ($i = 0; $i < 24; $i++) { foreach ($galleries as $gallery) { //Get file size for that hour for that gallery $start = $day." ".$i.":00:00"; diff --git a/app/Models/Traffic.php b/app/Models/Traffic.php index 17c70e7..833c55f 100644 --- a/app/Models/Traffic.php +++ b/app/Models/Traffic.php @@ -47,7 +47,7 @@ class Traffic extends Authenticatable ]; public static function getLastDays(int $days = 7) { - $sql = "SELECT year, month, SUM(traffic) AS `traffic` FROM traffic WHERE tenant = 1 GROUP BY year, month, day ORDER BY year, month, day DESC LIMIT ".$days.";"; + $sql = "SELECT year, month, day, SUM(traffic) AS `traffic` FROM traffic WHERE tenant = 1 GROUP BY year, month, day ORDER BY year, month, day DESC LIMIT ".$days.";"; $res = DB::select($sql); $now = new \DateTime( $days." days ago", new \DateTimeZone('UTC')); diff --git a/docs/setup-server.md b/docs/setup-server.md index a982447..d7ad915 100644 --- a/docs/setup-server.md +++ b/docs/setup-server.md @@ -54,7 +54,7 @@ Setup env ``` server { listen 80; - server_name kuvia.cloud www.kuvia.cloud; + server_name kuvia.cloud www.kuvia.cloud www1.kuvia.cloud www1.kuvia.cloud www2.kuvia.cloud www3.kuvia.cloud www4.kuvia.cloud www5.kuvia.cloud www6.kuvia.cloud www7.kuvia.cloud www8.kuvia.cloud www9.kuvia.cloud; root /var/www/kuvia/public; index index.html index.htm index.php;