From f80cb1194e1aa6270c954b8ed78cc73c85caf5f9 Mon Sep 17 00:00:00 2001 From: sayliraut Date: Wed, 10 Jul 2024 15:05:03 +0530 Subject: [PATCH] changes --- .../APIs/CustomerAPIs/RestaurantApiServices.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/Services/APIs/CustomerAPIs/RestaurantApiServices.php b/app/Services/APIs/CustomerAPIs/RestaurantApiServices.php index 5c93021..ebd32f6 100644 --- a/app/Services/APIs/CustomerAPIs/RestaurantApiServices.php +++ b/app/Services/APIs/CustomerAPIs/RestaurantApiServices.php @@ -112,7 +112,7 @@ class RestaurantApiServices public function DetailRestaurant($customerIamId, $id) { try { - $rest = ManageRestaurant::with('operatingHours')->select('id', 'short_id', 'name', 'description', 'restaurant_id', 'address', 'image', 'bio', 'try_on_1', 'try_on_2', 'try_on_3', 'try_on_4', 'exclusion', 'latitude', 'longtitude','state_xid')->where('short_id', $id)->where('is_active', '1')->first(); + $rest = ManageRestaurant::with('operatingHours')->select('id', 'short_id', 'name', 'description', 'restaurant_id', 'address', 'image', 'bio', 'try_on_1', 'try_on_2', 'try_on_3', 'try_on_4', 'exclusion', 'latitude', 'longtitude', 'state_xid')->where('short_id', $id)->where('is_active', '1')->first(); if ($rest) { $rest->image = ListingImageUrl('restaurant_images', $rest->image); @@ -126,13 +126,13 @@ class RestaurantApiServices ->where('is_redeem', "1") ->first(); - $Timeinterval = TimeInterval::where('manage_state_xid', $rest->state_xid)->first(); - $restTime = RestaurantTimeInterval::where('manage_restaurants_xid', $rest->id)->first(); + $Timeinterval = TimeInterval::where('manage_state_xid', $rest->state_xid)->first(); + $restTime = RestaurantTimeInterval::where('manage_restaurants_xid', $rest->id)->first(); - $timeIntervalHours = $Timeinterval->time_hours; - $restTimeHours = $restTime->time_hours; + $timeIntervalHours = $Timeinterval->time_hours; + $restTimeHours = $restTime->time_hours; - $greaterTime = max($timeIntervalHours, $restTimeHours); + $greaterTime = max($timeIntervalHours, $restTimeHours); @@ -273,6 +273,7 @@ class RestaurantApiServices // Count the redeems within the restaurant interval $redeemCountRestaurant = RedeemRestaurant::where('manage_restaurants_xid', $restaurant->id) + ->where('is_redeem', 1) ->where('iam_principal_xid', $customerIamId) ->count(); @@ -282,6 +283,7 @@ class RestaurantApiServices // Get the last redeem time $lastRedeem = RedeemRestaurant::where('iam_principal_xid', $customerIamId) + ->where('is_redeem', 1) ->orderBy('redeem_date', 'desc') ->first();