Compare commits

..

No commits in common. "47b65c9a3d5a479e72a78c4c72e36ede19e1e77f" and "ab11f1bc18906e90b21450c4d6852ef953c62860" have entirely different histories.

1 changed files with 23 additions and 25 deletions

View File

@ -160,31 +160,29 @@ class CropYieldController extends Controller
];
if ($crop?->is_end) {
$staticCropIds[] = $crop->id;
//注释掉扩展字段统计情况
// if ($crop->extends) {
// $i = 0;
// if(is_array($crop->extends)){
// $extends = $crop->extends;
// }else{
// $extends = json_decode($crop->extends, true);
// }
// foreach ($extends as $item) {
// $i++;
// $_key = 'extend_'.$i;
// $staticsData[$_key] = [
// 'name' => $item['name'],
// 'unit' => $item['unit'],
// 'list' => [
// '第1季度' => null,
// '第2季度' => null,
// '第3季度' => null,
// '第4季度' => null,
// ],
// ];
// $extendsQ .= ", sum((extends->> '".$item['name']."')::NUMERIC) as extend_".$i.'_total ';
// }
// }
if ($crop->extends) {
$i = 0;
if(is_array($crop->extends)){
$extends = $crop->extends;
}else{
$extends = json_decode($crop->extends, true);
}
foreach ($extends as $item) {
$i++;
$_key = 'extend_'.$i;
$staticsData[$_key] = [
'name' => $item['name'],
'unit' => $item['unit'],
'list' => [
'第1季度' => null,
'第2季度' => null,
'第3季度' => null,
'第4季度' => null,
],
];
$extendsQ .= ", sum((extends->> '".$item['name']."')::NUMERIC) as extend_".$i.'_total ';
}
}
} else {
$cropQ = Crop::query();
if ($crop) {