changes
This commit is contained in:
@@ -40,28 +40,40 @@ class RestaurantApi_Service
|
||||
->where('principal_xid', $userDetail->id)
|
||||
->get();
|
||||
|
||||
// $restaurantDetails = [];
|
||||
$restaurantDetails = [];
|
||||
$isActive = true;
|
||||
$inactiveMessage = "";
|
||||
|
||||
foreach ($restaurantRoles as $restaurantRole) {
|
||||
$restaurant = ManageRestaurant::select('id', 'name', 'description', 'restaurant_id', 'address', 'image', 'bio', 'try_on_1', 'phone_number', 'try_on_2', 'try_on_3', 'try_on_4', 'exclusion', 'latitude', 'longtitude', 'is_active', 'created_by', 'modified_by', 'deleted_at', 'created_at', 'updated_at')
|
||||
->where('id', $restaurantRole->restaurant_xid)
|
||||
->where('is_active', 1)
|
||||
->first();
|
||||
|
||||
if ($restaurant) {
|
||||
$restaurant->image = ListingImageUrl('restaurant_images', $restaurant->image);
|
||||
$restaurant->description = strip_tags($restaurant->description);
|
||||
|
||||
// $restaurantDetails[] = $restaurant;
|
||||
if ($restaurant->is_active == 0) {
|
||||
$isActive = false;
|
||||
$inactiveMessage = "Your restaurant is currently not participating in Cheers to the Season. Please reach out to contact@cheerstotheseason.com to re-enroll.";
|
||||
}
|
||||
|
||||
// Add restaurant details to the array
|
||||
$restaurantDetails[] = $restaurant;
|
||||
}
|
||||
}
|
||||
|
||||
// Construct response
|
||||
$response = [
|
||||
'user_detail' => $userDetail,
|
||||
'restaurant_details' => $restaurant,
|
||||
'restaurant_details' => $restaurantDetails,
|
||||
'is_active' => $isActive,
|
||||
];
|
||||
|
||||
if (!$isActive) {
|
||||
$response['message'] = $inactiveMessage;
|
||||
}
|
||||
|
||||
// Return JSON response with success message
|
||||
return jsonResponseWithSuccessMessageApi(__('auth.User_details_fetch'), $response, 200);
|
||||
} catch (Exception $ex) {
|
||||
@@ -74,6 +86,7 @@ class RestaurantApi_Service
|
||||
|
||||
|
||||
|
||||
|
||||
public function updateRestaurantDetail($restIamId, $request)
|
||||
{
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user