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) { if ($crop?->is_end) {
$staticCropIds[] = $crop->id; $staticCropIds[] = $crop->id;
if ($crop->extends) {
//注释掉扩展字段统计情况 $i = 0;
// if ($crop->extends) { if(is_array($crop->extends)){
// $i = 0; $extends = $crop->extends;
// if(is_array($crop->extends)){ }else{
// $extends = $crop->extends; $extends = json_decode($crop->extends, true);
// }else{ }
// $extends = json_decode($crop->extends, true); foreach ($extends as $item) {
// } $i++;
// foreach ($extends as $item) { $_key = 'extend_'.$i;
// $i++; $staticsData[$_key] = [
// $_key = 'extend_'.$i; 'name' => $item['name'],
// $staticsData[$_key] = [ 'unit' => $item['unit'],
// 'name' => $item['name'], 'list' => [
// 'unit' => $item['unit'], '第1季度' => null,
// 'list' => [ '第2季度' => null,
// '第1季度' => null, '第3季度' => null,
// '第2季度' => null, '第4季度' => 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) {