userId] ]; $data = Farm::where($where)->order('create_time desc')->select()->toArray(); return $this->success('请求成功',$data); } public function add() { $params = (new FarmValidate())->post()->goCheck('add'); $params['user_id'] = $this->userId; $result = FarmLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(FarmLogic::getError()); } }