|
|
@ -57,7 +57,24 @@ class FloorController extends BaseController |
|
|
if ($request->has('name')) { |
|
|
if ($request->has('name')) { |
|
|
$name = $request->input('name'); |
|
|
$name = $request->input('name'); |
|
|
if ($name) { |
|
|
if ($name) { |
|
|
$query->where('name', 'like', "%{$name}%"); |
|
|
$typeId = []; |
|
|
|
|
|
$nameTypeIds = AdminTranslationService::getLikeTypeIds(4, $name); |
|
|
|
|
|
if ($nameTypeIds) { |
|
|
|
|
|
$typeId = $nameTypeIds; |
|
|
|
|
|
} |
|
|
|
|
|
$query->where(function ($query) use ($name, $typeId) { |
|
|
|
|
|
$query->orWhere('name', 'like', "%{$name}%"); |
|
|
|
|
|
if ($typeId) { |
|
|
|
|
|
$query->orWhereIn('id', $typeId); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($request->has('floor_id')) { |
|
|
|
|
|
$floor_id = $request->input('floor_id'); |
|
|
|
|
|
if ($floor_id) { |
|
|
|
|
|
$query->where('id', $floor_id); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -274,7 +291,8 @@ class FloorController extends BaseController |
|
|
$data = [ |
|
|
$data = [ |
|
|
'building_floor_list' => get_select_data( |
|
|
'building_floor_list' => get_select_data( |
|
|
AdminFloorService::getBuildingFloor() |
|
|
AdminFloorService::getBuildingFloor() |
|
|
) |
|
|
), |
|
|
|
|
|
'floor_list' => AdminFloor::getData() |
|
|
]; |
|
|
]; |
|
|
return $this->responseService->success($data); |
|
|
return $this->responseService->success($data); |
|
|
} catch (Exception $e) { |
|
|
} catch (Exception $e) { |
|
|
|