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]); }