validate([ 'game_id' => ['nullable', 'string', 'min:1'], 'member_id' => ['nullable', 'string', 'min:1'], 'first_name' => ['nullable', 'string', 'min:1'], 'username' => ['nullable', 'string', 'min:1'], ]); $search = request()->all(); $result = UserService::paginate($search); } catch (ValidationException $e) { return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first()); } catch (Exception $e) { return $this->error(intval($e->getCode())); } return $this->success($result); } /** * @api {post} /admin/user/merge 账户合并 * @apiGroup 会员管理 * @apiDescription 合并后,余额,银行卡,USDT地址 将合并到新用户,请谨慎操作 * * @apiUse result * @apiUse header * @apiVersion 1.0.0 * * @apiParam {string} member_id 接收者的member_id * @apiParam {string} secret_key 被合并的用户的秘钥 */ public function merge(): JsonResponse { DB::beginTransaction(); try { $params = request()->validate([ 'member_id' => ['required', 'string', 'min:1'], 'secret_key' => ['required', 'string', 'min:1'], ]); $res = SecretService::migration($params['member_id'], $params['secret_key']); if (!$res) { throw new Exception("迁移失败", HttpStatus::CUSTOM_ERROR); } DB::commit(); } catch (ValidationException $e) { DB::rollBack(); return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first()); } catch (Exception $e) { DB::rollBack(); return $this->error(intval($e->getCode())); } return $this->success(msg: '已完成迁移'); } public function address() { try { request()->validate([ 'member_id' => ['required', 'integer', 'min:1'], ]); $search = request()->all(); $result = AddressService::findAll($search); } catch (ValidationException $e) { return $this->error(HttpStatus::CUSTOM_ERROR, $e->validator->errors()->first()); } catch (Exception $e) { return $this->error(intval($e->getCode())); } return $this->success($result); } }