diff --git a/app/Http/Controllers/GeneralController.php b/app/Http/Controllers/GeneralController.php index bf3e7ac..5f76820 100644 --- a/app/Http/Controllers/GeneralController.php +++ b/app/Http/Controllers/GeneralController.php @@ -29,7 +29,7 @@ class GeneralController extends Controller $endDate = Carbon::parse($request->end_date)->format('m/d/Y'); } - $charts = Sale::selectRaw('COUNT(id) as count, date') + $charts = Sale::selectRaw('SUM(total) as stotal, date') ->whereBetween('date', [$startDate, $endDate]) ->orderBy('date', 'asc') ->groupBy('date') diff --git a/resources/js/Pages/Dashboard.jsx b/resources/js/Pages/Dashboard.jsx index 6d393d7..8aff3c4 100644 --- a/resources/js/Pages/Dashboard.jsx +++ b/resources/js/Pages/Dashboard.jsx @@ -30,8 +30,8 @@ export default function Dashboard(props) { labels: sale_days.map((item) => item.date), datasets: [ { - label: 'Sales', - data: sale_days.map((item) => item.count), + label: 'Penjualan', + data: sale_days.map((item) => item.stotal), // backgroundColor: 'rgb(87, 13, 248, 0.5)', //rgb(87, 13, 248, 0.5) //rgba(255, 99, 132, 0.5) backgroundColor: [ 'rgba(201, 203, 207, 1)',