This commit is contained in:
Kekskurse 2021-01-12 19:28:35 +01:00
parent eb837eab0a
commit c6d6fb7b78

View file

@ -49,7 +49,7 @@ class CalculateSpace extends Command
//Get file size for that hour for that gallery //Get file size for that hour for that gallery
$start = $day." ".$i.":00:00"; $start = $day." ".$i.":00:00";
$end = $day." ".$i.":59:59"; $end = $day." ".$i.":59:59";
$sql = "SELECT SUM(size) AS size FROM `go-mysql-admin`.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;
$split = explode("-", $day); $split = explode("-", $day);
$storage = \App\Models\Storage::query() $storage = \App\Models\Storage::query()