增加种植详情接口
This commit is contained in:
parent
762a5c5f11
commit
c5f29c6164
|
@ -24,6 +24,20 @@
|
|||
return $this->success('请求成功',$data);
|
||||
}
|
||||
|
||||
public function detail(): Json
|
||||
{
|
||||
$params = $this->request->get(['plant_id']);
|
||||
if(empty($params['plant_id'])){
|
||||
return $this->fail('缺少必要参数');
|
||||
}
|
||||
$data = Plant::where('id',$params['plant_id'])->findOrEmpty();
|
||||
if($data->isEmpty()){
|
||||
return $this->fail('种植信息错误');
|
||||
}
|
||||
$data['pic'] = json_decode($data['pic'],true);
|
||||
return $this->success('请求成功',$data->toArray());
|
||||
}
|
||||
|
||||
//添加种植
|
||||
public function add(): Json
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue