Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Commit

Permalink
Use readable timeformat
Browse files Browse the repository at this point in the history
  • Loading branch information
mms-gianni committed Sep 28, 2020
1 parent 90622e2 commit d416be0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Http/Controllers/ReportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public function overview($report_uid=null)
{
if ($report_uid == null) {
$report = DB::table('k_reports')
->select('uid')
->selectRaw("to_char(k_reports.checktime, 'DD.MM.YYYY HH24:MI') as checktime")
->orderBy('checktime', 'DESC')
->first();

Expand All @@ -27,6 +29,8 @@ public function overview($report_uid=null)
$report_uid = $report->uid;
} else {
$report = DB::table('k_reports')
->select('uid')
->selectRaw("to_char(k_reports.checktime, 'DD.MM.YYYY HH24:MI') as checktime")
->where('uid', $report_uid)
->first();
}
Expand All @@ -38,6 +42,8 @@ public function overview($report_uid=null)
$data['report_data'] = $report;

$data['reports'] = DB::table('k_reports')
->select('uid')
->selectRaw("to_char(k_reports.checktime, 'DD.MM HH24:MI') as checktime")
->distinct('uid')
->get()
->toArray();
Expand Down

0 comments on commit d416be0

Please sign in to comment.