dev
Jing Li 2022-11-16 16:19:18 +08:00
parent 5756e59ab7
commit a9a72b51a9
1 changed files with 10 additions and 6 deletions

View File

@ -87,9 +87,9 @@ class ChartController extends Controller
$riceShrimpIndustry = $riceShrimpIndustries[$key] ?? null;
if ($riceShrimpIndustry) {
$areas[] = bcdiv($riceShrimpIndustry->area, 1000, 2);
$productOutputs[] = bcdiv($riceShrimpIndustry->product_output, 2000, 2);
$productValues[] = bcdiv($riceShrimpIndustry->product_value, 10000, 2);;
$areas[] = $riceShrimpIndustry->area;
$productOutputs[] = $riceShrimpIndustry->product_output;
$productValues[] = $riceShrimpIndustry->product_value;
} else {
$areas[] = null;
$productOutputs[] = null;
@ -97,19 +97,21 @@ class ChartController extends Controller
}
}
$riceShrimpIndustry = $riceShrimpIndustries->first();
return [
'x_axis' => array_values($quarters),
'series' => [
[
'name' => '产值(万元)',
'name' => '产值' . ($riceShrimpIndustry ? "({$riceShrimpIndustry->product_value_unit})" : ''),
'data' => $productValues,
],
[
'name' => '面积(千亩)',
'name' => '面积' . ($riceShrimpIndustry ? "({$riceShrimpIndustry->area_unit})" : ''),,
'data' => $areas,
],
[
'name' => '产量(吨)',
'name' => '产量' . ($riceShrimpIndustry ? "({$riceShrimpIndustry->product_output_unit})" : ''),,
'data' => $productOutputs,
],
],
@ -152,6 +154,7 @@ class ChartController extends Controller
});
return [
'unit' => $riceShrimpFlows->first()?->unit,
'x_axis' => array_values($quarters),
'series' => $series->values()->all(),
];
@ -199,6 +202,7 @@ class ChartController extends Controller
});
return [
'unit' => $materiels->first()?->unit,
'x_axis' => array_values($quarters),
'series' => $series->values()->all(),
];