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