This commit is contained in:
Kekskurse 2021-01-15 23:09:11 +01:00
parent 33bc29d39c
commit 510bca3666

View file

@ -57,6 +57,7 @@ class CalculateSpace extends Command
$end = $day." ".$i.":59:59"; $end = $day." ".$i.":59:59";
$sql = "SELECT SUM(size) AS size FROM images WHERE gallery = ".$gallery->id." AND uploaded_at < \"".$start."\" AND (deleted_at > \"".$end."\" OR deleted_at IS NULL);"; $sql = "SELECT SUM(size) AS size FROM images WHERE gallery = ".$gallery->id." AND uploaded_at < \"".$start."\" AND (deleted_at > \"".$end."\" OR deleted_at IS NULL);";
$size = DB::select($sql)[0]->size; $size = DB::select($sql)[0]->size;
$this->info("Size: ".$size);
$split = explode("-", $day); $split = explode("-", $day);
$storage = \App\Models\Storage::query() $storage = \App\Models\Storage::query()
->where("gallery", "=", $gallery->id) ->where("gallery", "=", $gallery->id)