get(); $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 { $info = $this->service->getOrder(['id'=>$id]); if ($info->isEmpty()) return errorTrans("empty.error"); return successTrans("success.data",$info->toArray()); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } #[Route(path: "affirm/{id}",methods: "post")] public function affirm($id): Response { try { $state = $this->service->affirm($id); if (!$state) return errorTrans("error.data"); return successTrans("success.data"); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } #[Route(path: "reject/{id}",methods: "post")] public function reject(Request $request,$id): Response { try { $remark = $request->post('remark'); $state = $this->service->reject($id,$remark); if (!$state) return errorTrans("error.data"); return successTrans("success.data"); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } #[Route(path: "settle/{id}",methods: "post")] public function settle(Request $request,$id): Response { try { $state = $this->service->settle($id); if (!$state) return errorTrans("error.data"); return successTrans("success.data"); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } }