Compare commits
No commits in common. "26b4fbebc621da70a83f5ee6f07c8359a69238de" and "2ab644ff2f88175304273edda5970822ea07920b" have entirely different histories.
26b4fbebc6
...
2ab644ff2f
|
@ -99,18 +99,10 @@
|
||||||
if(empty($params['plant_id'])){
|
if(empty($params['plant_id'])){
|
||||||
return $this->fail('缺少必要参数');
|
return $this->fail('缺少必要参数');
|
||||||
}
|
}
|
||||||
$data = Db::query("SELECT * FROM zzsy_land_plant_action WHERE id IN (SELECT max( id ) FROM zzsy_land_plant_action WHERE plant_id = {$params['plant_id']} GROUP BY type)");
|
$data = Action::where('plant_id',$params['plant_id'])->order('create_time asc')->select()->each(function($item){
|
||||||
return $this->success('请求成功',$data);
|
$item['detail'] = json_decode($item['detail'],true);
|
||||||
}
|
return $item;
|
||||||
|
})->toArray();
|
||||||
//单一操作列表
|
|
||||||
public function listForType(): Json
|
|
||||||
{
|
|
||||||
$params = $this->request->get(['plant_id','type']);
|
|
||||||
if(empty($params['plant_id']) || empty($params['type'])){
|
|
||||||
return $this->fail('缺少必要参数');
|
|
||||||
}
|
|
||||||
$data = Action::where('plant_id',$params['plant_id'])->where('type',$params['type'])->select()->toArray();
|
|
||||||
return $this->success('请求成功',$data);
|
return $this->success('请求成功',$data);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -48,15 +48,6 @@
|
||||||
if($data->isEmpty()){
|
if($data->isEmpty()){
|
||||||
return $this->fail('土地信息不存在');
|
return $this->fail('土地信息不存在');
|
||||||
}
|
}
|
||||||
if($data['user_id'] != $this->userId){
|
|
||||||
return $this->fail('土地信息与用户信息不匹配');
|
|
||||||
}
|
|
||||||
$landProduct = LandProduct::where('land_id',$params['land_id'])->findOrEmpty();
|
|
||||||
if($landProduct->isEmpty()){
|
|
||||||
$data['is_bind_product'] = 0;
|
|
||||||
}else{
|
|
||||||
$data['is_bind_product'] = 1;
|
|
||||||
}
|
|
||||||
$data['pic'] = json_decode($data['pic'],true);
|
$data['pic'] = json_decode($data['pic'],true);
|
||||||
return $this->success('请求成功',$data->toArray());
|
return $this->success('请求成功',$data->toArray());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue