|
|
@ -46,7 +46,17 @@ class ParkingDepartureReasonController extends BaseController |
|
|
if ($request->has('reason')) { |
|
|
if ($request->has('reason')) { |
|
|
$reason = $request->input('reason'); |
|
|
$reason = $request->input('reason'); |
|
|
if ($reason) { |
|
|
if ($reason) { |
|
|
$query->where('reason', 'like', "%{$reason}%"); |
|
|
$typeIds = []; |
|
|
|
|
|
$reasonTypeIds = AdminTranslationService::getLikeTypeIds(8, $reason); |
|
|
|
|
|
if ($reasonTypeIds) { |
|
|
|
|
|
$typeIds = $reasonTypeIds; |
|
|
|
|
|
} |
|
|
|
|
|
$query->where(function ($query) use ($reason, $typeIds) { |
|
|
|
|
|
$query->orWhere('reason', 'like', "%{$reason}%"); |
|
|
|
|
|
if ($typeIds) { |
|
|
|
|
|
$query->orWhereIn('id', $typeIds); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|