helpers updated

This commit is contained in:
developer 2026-03-26 15:38:06 +08:00
parent 4fcd31d75c
commit 90f4f6f39a

View File

@ -105,7 +105,7 @@ function GetAvailableComplexes()
$complexes = Complex::where('city_id', $cityManager->first()->city_id); $complexes = Complex::where('city_id', $cityManager->first()->city_id);
} else { } else {
if ($agent = Agent::where('user_id', auth()->user()->id)->first()) { if ($agent = Agent::where('user_id', auth()->user()->id)->first()) {
$complexes = Complex::where('city_id', $agent->company->city_id); $complexes = Complex::where('city_id', $agent->company?->city_id);
} }
} }
} }