Commit b41632eb authored by Andrea Ruggiero's avatar Andrea Ruggiero
Browse files

Update for supporting latest db

parent 227819bd
Pipeline #1646 failed with stage
in 1 minute and 28 seconds
......@@ -32,9 +32,10 @@ class AccomodationController extends Controller
return ApiResponse::success([ 'accomodation' => [
"address" => $accomodation->address,
"n_seats" => $accomodation->n_seats,
"owner_name" => $accomodation->owner_name,
"owner_surname" => $accomodation->owner_surname,
"phone_number" => $accomodation->phone_number,
"cell_number" => $accomodation->cell_number,
"latitude" => $accomodation->latitude,
"longitude" => $accomodation->longitude
]
......
......@@ -70,7 +70,7 @@ class EventController extends Controller
"theme" => $event->theme,
"bookings" => count($bookingRepository->getBookingsByEvent($event->event_id)),
"places" => $places,
"image" => count($places) > 0 ? $this->getImage($places[0], $event->title) : null
"image" => count($places) > 0 ? $this->getImage($places[0], $event->title) : 'http://185.53.148.21/0/0.jpg'
];
if ($user !== null) {
......@@ -135,7 +135,7 @@ class EventController extends Controller
"theme" => $event->theme,
"bookings" => count($bookingRepository->getBookingsByEvent($event->event_id)),
"places" => $places,
"image" => count($places) > 0 ? $this->getImage($places[0], $event->title) : null
"image" => count($places) > 0 ? $this->getImage($places[0], $event->title) : 'http://185.53.148.21/0/0.jpg'
];
$response[] = $temp;
......@@ -220,7 +220,7 @@ class EventController extends Controller
"theme" => $event->theme,
"bookings" => count($bookingRepository->getBookingsByEvent($event->event_id)),
"places" => $places,
"image" => count($places) > 0 ? $this->getImage($places[0], $event->title) : null
"image" => count($places) > 0 ? $this->getImage($places[0], $event->title) : 'http://185.53.148.21/0/0.jpg'
];
if ($user !== null) {
......@@ -236,11 +236,11 @@ class EventController extends Controller
1 => 0,
2 => 2,
3 => 4,
4 => 0,
4 => 2,
5 => 4,
6 => 2
];
if ($total[$place["id"]] == 0) return null;
if ($total[$place["id"]] == 0) return 'http://185.53.148.21/0/0.jpg';
$md5 = md5($title);
return 'http://185.53.148.21/'.$place["id"].'/'.abs($md5[0] % $total[$place["id"]]).'.jpg';
}
......
......@@ -27,10 +27,12 @@ class RestaurantController extends Controller
"address" => $restaurant->address,
"latitude" => $restaurant->latitude,
"longitude" => $restaurant->longitude,
"phone_number" => $restaurant->phone_number
"phone_number" => $restaurant->phone_number,
'image' => 'http://185.53.148.21/r/'.$restaurant->restaurant_id.'.jpg'
];
}
return ApiResponse::success($response);
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment