changes
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user