diff --git a/includes/model/Shifts_model.php b/includes/model/Shifts_model.php index 3925460a..0e9022ff 100644 --- a/includes/model/Shifts_model.php +++ b/includes/model/Shifts_model.php @@ -85,6 +85,7 @@ function Shifts_free($start, $end, ShiftsFilter $filter = null) return Shift::query() ->whereIn('id', $shifts->pluck('id')->toArray()) + ->orderBy('shifts.start') ->get(); } diff --git a/includes/model/Stats.php b/includes/model/Stats.php index adc4af32..afd5cb60 100644 --- a/includes/model/Stats.php +++ b/includes/model/Stats.php @@ -1,6 +1,7 @@ addHours(3)->toDateTimeString(); $result = Db::selectOne(' SELECT SUM(`count`) AS `count` FROM ( SELECT @@ -157,6 +158,8 @@ function stats_angels_needed_for_nightshifts(ShiftsFilter $filter = null) date('Y-m-d', time() + 12 * 60 * 60) . ' ' . $nightStartTime . ':00' ); $night_end = $night_start + ($nightEndTime - $nightStartTime) * 60 * 60; + $night_start = Carbon::createFromTimestamp($night_start)->toDateTimeString(); + $night_end = Carbon::createFromTimestamp($night_end)->toDateTimeString(); $result = Db::selectOne(' SELECT SUM(`count`) AS `count` FROM ( SELECT