Fix database column issues and shamCash join

This commit is contained in:
Hamza-Ayed
2026-04-25 12:06:15 +03:00
parent b4dd178075
commit 8545c09b76
2 changed files with 5 additions and 7 deletions

View File

@@ -454,18 +454,19 @@ class AuthController extends Controller
->table('driver as d')
->leftJoin('phone_verification', 'phone_verification.phone_number', '=', 'd.phone')
->leftJoin('invites', 'invites.inviterDriverPhone', '=', 'd.phone')
->leftJoin('shamCash', 'shamCash.driver_id', '=', 'd.id')
->leftJoin('driver_gifts', 'driver_gifts.driver_id', '=', 'd.id')
->leftJoin('CarRegistration', 'CarRegistration.driverID', '=', 'd.id')
->leftJoin('captain_bank', 'captain_bank.captain_id', '=', 'd.id')
->select([
'd.id', 'd.phone', 'd.email', 'd.gender', 'd.status',
'd.first_name', 'd.last_name',
'd.name_arabic',
'd.accountBank', 'd.bankCode',
'phone_verification.verified as is_verified',
'invites.isInstall',
'shamCash.is_claimed',
'driver_gifts.is_claimed',
'CarRegistration.make', 'CarRegistration.model', 'CarRegistration.year',
'captain_bank.bankCode', 'captain_bank.accountBank',
'captain_bank.bankCode as bank_code_alt', 'captain_bank.accountBank as account_bank_alt',
])
->where('d.id', $id)
->first();
@@ -577,15 +578,12 @@ class AuthController extends Controller
->update([
'fingerPrint' => $request->input('fingerPrint'),
'token' => $request->input('fcm_token'),
'updated_at' => now()
]);
} else {
DB::connection('primary')->table('driverToken')->insert([
'captain_id' => $driver->id,
'fingerPrint' => $request->input('fingerPrint'),
'token' => $request->input('fcm_token'),
'created_at' => now(),
'updated_at' => now()
]);
}

View File

@@ -288,7 +288,7 @@ class OtpController extends Controller
/** GET /v2/otp/check-phone?phone=XXX */
public function checkPhone(Request $request): JsonResponse
{
$phone = $request->input('phone') ?? $request->query('phone');
$phone = $request->input('phone') ?? $request->input('phone_number') ?? $request->query('phone') ?? $request->query('phone_number');
if (!$phone) {
return $this->failure('Phone parameter is missing', 400);