Skip to content

Commit

Permalink
fix: report pdf food record order
Browse files Browse the repository at this point in the history
  • Loading branch information
amrron committed Oct 28, 2024
1 parent 346a24b commit 085c91f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ public function reportPdf(Request $request) {
$foodRecords = $foodRecords->where('created_at', '<=', $request->to . ' 23:59');
}

$foodRecords = $foodRecords->latest()->get();
$foodRecords = $foodRecords->get()->sortBy('waktu');
$catatanPerTanggal = $foodRecords->groupBy('tanggalWaktu');
$total_jumlah = $foodRecords->sum('jumlah');
$total_karbohidrat = $foodRecords->sum(function($catatan){ return $catatan->jumlah * $catatan->karbohidrat; });
Expand Down

0 comments on commit 085c91f

Please sign in to comment.