调整基地
parent
07a4c4c261
commit
51c5e7e503
|
|
@ -56,6 +56,7 @@ class AgriculturalBaseController extends Controller
|
|||
|
||||
public function show(AgriculturalBase $agriculturalBasic)
|
||||
{
|
||||
$agriculturalBasic->load('crops');
|
||||
return $this->json(AgriculturalBaseResource::make($agriculturalBasic));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class AgriculturalBaseResource extends JsonResource
|
|||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'address' => $this->address ?? '',
|
||||
'person' => $this->person ?? '',
|
||||
'address_lat' => $this->address_lat ?? '',
|
||||
'address_lng' => $this->address_lng ?? '',
|
||||
'description' => $this->description ?? '',
|
||||
|
|
@ -25,6 +26,7 @@ class AgriculturalBaseResource extends JsonResource
|
|||
'areas' => ($this->areas ?? 0.00),//占地面积
|
||||
'workforce' => $this->workforce ?? 0,//人数
|
||||
'cultivated' =>$this->cultivated ?? 0,//种养殖面积
|
||||
'crops' => CropResource::collection($this->whenLoaded('crops')),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue