From 80ffd8991eeb4c9fcb7d12f2eea581777612db7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8F=82=E7=8F=82?= Date: Fri, 6 Dec 2024 21:17:37 +0800 Subject: [PATCH] dev --- packages/bydauto/src/Controllers/BYDAutoController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/bydauto/src/Controllers/BYDAutoController.php b/packages/bydauto/src/Controllers/BYDAutoController.php index acf6620..351d9be 100644 --- a/packages/bydauto/src/Controllers/BYDAutoController.php +++ b/packages/bydauto/src/Controllers/BYDAutoController.php @@ -23,8 +23,10 @@ public function testdrive(Request $request) $requestId = Str::uuid(); $request->merge(['request_id' => $requestId]); - $model = (new TestdriveCreateAction())->execute($request); - // TestdrivePushJob::dispatch($model); + $exists = Testdrive::query()->where('mobile', $request->input('mobile'))->exists(); + throw_if($exists, ValidationException::withMessages(['mobile' => '手机号已存在'])); + + (new TestdriveCreateAction())->execute($request); return response()->json(['code' => 0, 'message' => '提交成功', 'request_id' => $requestId]); }