|
|
@ -91,11 +91,11 @@ class AuthApiController extends BaseAuthApiController |
|
|
|
// return $this->sendError('Validation Error.', $validator->errors()); |
|
|
|
// return $this->sendError('Validation Error.', $validator->errors()); |
|
|
|
// } |
|
|
|
// } |
|
|
|
if (empty($request->agents_code)) { |
|
|
|
if (empty($request->agents_code)) { |
|
|
|
return response()->json(['status' => true, 'message' => 'Đăng ký thất bại, vui lòng gửi lên mã đại lý.']); |
|
|
|
return response()->json(['status' => false, 'message' => 'Đăng ký thất bại, vui lòng gửi lên mã đại lý.']); |
|
|
|
} |
|
|
|
} |
|
|
|
$checkUserAgent = AgentUser::where('code', '=', $request->agents_code)->first(); |
|
|
|
$checkUserAgent = AgentUser::where('code', '=', $request->agents_code)->first(); |
|
|
|
if (empty($checkUserAgent)) { |
|
|
|
if (empty($checkUserAgent)) { |
|
|
|
return response()->json(['status' => true, 'message' => 'Đăng ký thất bại, Không tìm thấy đại lý.']); |
|
|
|
return response()->json(['status' => false, 'message' => 'Đăng ký thất bại, Không tìm thấy đại lý.']); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
$dataInsert = $this->transformRegisterData($request->all()); |
|
|
|
$dataInsert = $this->transformRegisterData($request->all()); |
|
|
|