dev
李静 2023-05-16 17:13:55 +08:00
parent a6eb77838e
commit 666cd6fa88
1 changed files with 4 additions and 1 deletions

View File

@ -69,7 +69,9 @@ class ChartController extends Controller
*/
public function riceShrimpWeeklyPrice(Request $request)
{
$weeks = Keywords::where('type_key', 'weeks-per-year')->pluck('name', 'key');
$now = now();
$weeks = Keywords::where('type_key', 'weeks-per-year')->pluck('name', 'id');
$years = RiceShrimpWeeklyPrice::select('year')
->groupBy('year')
@ -98,6 +100,7 @@ class ChartController extends Controller
});
return [
'c_week' => ($now->month - 1) * 4 + ($now->weekOfMonth > 4 ? 4 : $now->weekOfMonth),
'x_axis' => $weeks->values(),
'series' => $series->sortKeys()->values()->all(),
];