new
parent
6ad0fe85e6
commit
142c65cedc
|
|
@ -270,7 +270,7 @@ class MobileApiController extends Controller
|
|||
|
||||
$availableCars = $cars->reject(fn($car) => in_array($car->id, $busyCars));
|
||||
|
||||
return response()->json($availableCars->isNotEmpty());
|
||||
return $availableCars->isNotEmpty();
|
||||
}
|
||||
|
||||
public function getAvailableMarksList(Request $request): JsonResponse
|
||||
|
|
@ -305,7 +305,6 @@ class MobileApiController extends Controller
|
|||
|
||||
$cars = UniModel::model('pipi_auto')->where('model_id', $mark->id)->get();
|
||||
|
||||
|
||||
if ($cars->isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -343,10 +342,6 @@ class MobileApiController extends Controller
|
|||
$colorPath = url('api/files/file/' . ltrim($photo->path, '/'));
|
||||
}
|
||||
|
||||
if (!$this->checkAvailableCar($started_at, $ended_at, $mark->id, $carColor->code)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$key = $mark->name . '-' . $mark->year . '-' . $carColor->code;
|
||||
|
||||
$availableMarks[$key] = [
|
||||
|
|
@ -367,6 +362,7 @@ class MobileApiController extends Controller
|
|||
'deposit' => $tariffs_new[0]['deposit'] ?? 30000,
|
||||
'conditioner' => $mark?->conditioner,
|
||||
'photo' => $colorPath,
|
||||
'free' => $this->checkAvailableCar($started_at, $ended_at, $mark->id, $carColor->id),
|
||||
'tariffs' => $tariffs_new,
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue