get(); $param['status'] = 1; $param['is_del'] = 0; $param['type'] = $param['type']??0; $user = (new Auth)->guard("user")->user(); if($user){ // $param['grade'] = $user['level']; $param['uid'] = $user['uid']; }else{ // $param['grade'] = 1; $param['uid'] = 0; } $list = $this->service->getList($param,'*',$param['page']??0,$param['limit']??0); return successTrans("success.data",$list); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } #[Route(path: "info/{id}",methods: "get")] public function info($id): Response { try { $take = $this->service->getInfo(["id"=>$id]); if ($take->isEmpty()) return errorTrans("empty.error"); $this->service->incField(["id"=>$id],'hot',1); return successTrans("success.data",$take->toArray(),200); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } }