guard("user")->user()->toArray(); $param = $request->post(); if (!$this->validate->check($param)) return error($this->validate->getError()); $param['uid'] = $user['uid']; if($user['is_cutter']) return errorTrans("您已成为剪辑师,请勿重复操作"); $apply = $this->cutterApplyService->getOne(['uid'=>$param['uid']]); if(!$apply->isEmpty()){ $param['status'] = 0; $state = $this->cutterApplyService->update($apply['id'],$param); }else{ $state = $this->cutterApplyService->save($param); } if (!$state) return errorTrans("error.data"); return successTrans("success.data"); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } /** * 申请剪辑师详情 * @param Request $request * @return Response */ #[Route(path: "cutter/apply/info",methods: "get")] public function cutter_apply_info(Request $request): Response { try { $user = (new Auth)->guard("user")->user()->toArray(); $apply = $this->cutterApplyService->getOne(['uid'=>$user['uid']]); return successTrans("success.data",$apply?$apply->toArray():[]); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } }