dev
parent
ef1eb76159
commit
cb1fc1e0d9
|
|
@ -160,29 +160,31 @@ 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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue