dev
parent
2a22d31f4c
commit
b4d4b022c8
|
|
@ -160,7 +160,11 @@ class CropYieldController extends Controller
|
||||||
$staticCropIds[] = $crop->id;
|
$staticCropIds[] = $crop->id;
|
||||||
if ($crop->extends) {
|
if ($crop->extends) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
if(is_array($crop->extends)){
|
||||||
|
$extends = $crop->extends;
|
||||||
|
}else{
|
||||||
$extends = json_decode($crop->extends, true);
|
$extends = json_decode($crop->extends, true);
|
||||||
|
}
|
||||||
foreach ($extends as $item) {
|
foreach ($extends as $item) {
|
||||||
$i++;
|
$i++;
|
||||||
$_key = 'extend_'.$i;
|
$_key = 'extend_'.$i;
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ class CropYieldListResource extends JsonResource
|
||||||
'yield' => $this->formatNumber($this->yield).$this->whenLoaded('crop', function () {
|
'yield' => $this->formatNumber($this->yield).$this->whenLoaded('crop', function () {
|
||||||
return $this->crop?->unit;
|
return $this->crop?->unit;
|
||||||
}, ''),
|
}, ''),
|
||||||
'output' => $this->formatNumber($this->output),
|
'output' => $this->formatNumber($this->output).'元',
|
||||||
'cultivated' => $this->formatNumber($this->cultivated),
|
'cultivated' => $this->formatNumber($this->cultivated).'亩',
|
||||||
'extends' => $this->extends,
|
'extends' => $this->extends,
|
||||||
'created_by' => $this->whenLoaded('createdBy', function () {
|
'created_by' => $this->whenLoaded('createdBy', function () {
|
||||||
return $this->createdBy?->name;
|
return $this->createdBy?->name;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue