dev
parent
2a22d31f4c
commit
b4d4b022c8
|
|
@ -160,7 +160,11 @@ class CropYieldController extends Controller
|
|||
$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;
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ class CropYieldListResource extends JsonResource
|
|||
'yield' => $this->formatNumber($this->yield).$this->whenLoaded('crop', function () {
|
||||
return $this->crop?->unit;
|
||||
}, ''),
|
||||
'output' => $this->formatNumber($this->output),
|
||||
'cultivated' => $this->formatNumber($this->cultivated),
|
||||
'output' => $this->formatNumber($this->output).'元',
|
||||
'cultivated' => $this->formatNumber($this->cultivated).'亩',
|
||||
'extends' => $this->extends,
|
||||
'created_by' => $this->whenLoaded('createdBy', function () {
|
||||
return $this->createdBy?->name;
|
||||
|
|
|
|||
Loading…
Reference in New Issue