Fix
parent
a9a72b51a9
commit
4dddd637fc
|
|
@ -69,8 +69,9 @@ class ChartController extends Controller
|
||||||
{
|
{
|
||||||
$riceShrimpIndustries = RiceShrimpIndustry::query()
|
$riceShrimpIndustries = RiceShrimpIndustry::query()
|
||||||
->where('year', $request->query('year', date('Y')))
|
->where('year', $request->query('year', date('Y')))
|
||||||
->get()
|
->get();
|
||||||
->mapWithKeys(fn ($item) => [$item['quarter'] => $item]);
|
|
||||||
|
$mapRiceShrimpIndustries = $riceShrimpIndustries->mapWithKeys(fn ($item) => [$item['quarter'] => $item]);
|
||||||
|
|
||||||
$quarters = [
|
$quarters = [
|
||||||
1 => '1季度',
|
1 => '1季度',
|
||||||
|
|
@ -84,7 +85,7 @@ class ChartController extends Controller
|
||||||
$productValues = [];
|
$productValues = [];
|
||||||
|
|
||||||
foreach ($quarters as $key => $value) {
|
foreach ($quarters as $key => $value) {
|
||||||
$riceShrimpIndustry = $riceShrimpIndustries[$key] ?? null;
|
$riceShrimpIndustry = $mapRiceShrimpIndustries[$key] ?? null;
|
||||||
|
|
||||||
if ($riceShrimpIndustry) {
|
if ($riceShrimpIndustry) {
|
||||||
$areas[] = $riceShrimpIndustry->area;
|
$areas[] = $riceShrimpIndustry->area;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue