all(); $param['openid'] = $request->user['openid']; $data = $this->model->where("openid",$param['openid'])->findOrEmpty(); if (!$data->isEmpty()) { if ($data['status'] <> 1) return error("请勿重复提交"); }; if (!$this->validate->scene('add')->check($param)) return error($this->validate->getError()); $state = $data->setAutoData($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: "user/check",methods: "get")] public function checkUserCert(Request $request): Response { try { $data = $this->model->where("openid",$request->user['openid'])->findOrEmpty(); if ($data->isEmpty()) return success("ok",['status' => 0]); if ($data['status'] == 2) return success("ok",['status' => 2,"remark" => $data['remark']]); return success("ok",['status' => 1]); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } /** * @param Request $request * @return Response */ #[Route(path: "group",methods: "post")] public function setGroupCert(Request $request): Response { try { $param = $request->all(); $param['openid'] = $request->user['openid']; $data = $this->modelGroup->where("openid",$param['openid'])->findOrEmpty(); if (!$data->isEmpty()) { if ($data['status'] <> 1) return error("请勿重复提交"); }; if (!$this->groupValidate->scene('add')->check($param)) return error($this->groupValidate->getError()); $state = $data->setAutoData($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: "group/check",methods: "get")] public function checkGroupCert(Request $request): Response { try { $data = $this->modelGroup->where("openid",$request->user['openid'])->findOrEmpty(); if ($data->isEmpty()) return success("ok",['status' => 0]); if ($data['status'] == 2) return success("ok",['status' => 2,"remark" => $data['remark']]); return success("ok",['status' => 1]); } catch (\Throwable $throwable) { return error($throwable->getMessage()); } } }