@php
$admin = App\Models\AdminUser::Where(
'kitchen_detail_id',
$kitchen->id,
)->first();
$pluck_order_id = App\Models\Order::where(
'kitchen_id',
$admin->id,
)->pluck('id');
$order_rating_sum = App\Models\OrderRating::whereIn(
'order_id',
$pluck_order_id,
)->sum('rating_value');
if ($order_rating_sum != null) {
$order_rating_count = App\Models\OrderRating::whereIn(
'order_id',
$pluck_order_id,
)->count();
if ($order_rating_count != 0) {
$rating =
$order_rating_sum /
$order_rating_count;
$rating_count = $order_rating_count;
} else {
$rating = 0;
$rating_count = 0;
}
$shop_rating = round($rating, 1);
$rating_count = $rating_count;
} else {
$rating = 0;
$rating_count = 0;
$shop_rating = round($rating, 1);
$rating_count = $rating_count;
}
@endphp
@if ($shop_rating != 0)
{{-- --}}
@endif
{{ $kitchen->zone->name }}
.{{ round($kitchen->distance, 2) }} km
{{ $kitchen->brand->name }} food
@if (count($kitchen->offer) > 0) @foreach ($kitchen->offer as $offer) @php if ( $offer->offer_code ->delivery_charge_status == 1 ) { $st[] = $offer->offer_code; } else { $st = []; } @endphp @endforeach @if (count($st) > 0)
@php
$admin = App\Models\AdminUser::Where(
'kitchen_detail_id',
$kitchen->id,
)->first();
$pluck_order_id = App\Models\Order::where(
'kitchen_id',
$admin->id,
)->pluck('id');
$order_rating_sum = App\Models\OrderRating::whereIn(
'order_id',
$pluck_order_id,
)->sum('rating_value');
if ($order_rating_sum != null) {
$order_rating_count = App\Models\OrderRating::whereIn(
'order_id',
$pluck_order_id,
)->count();
if ($order_rating_count != 0) {
$rating =
$order_rating_sum /
$order_rating_count;
$rating_count = $order_rating_count;
} else {
$rating = 0;
$rating_count = 0;
}
$shop_rating = round($rating, 1);
$rating_count = $rating_count;
} else {
$rating = 0;
$rating_count = 0;
$shop_rating = round($rating, 1);
$rating_count = $rating_count;
}
@endphp
@if ($shop_rating != 0)
{{-- --}}
@endif
{{ $kitchen->zone->name }}
.{{ round($kitchen->distance, 2) }} km
{{ $kitchen->brand->name }} food
@if (count($kitchen->offer) > 0) @foreach ($kitchen->offer as $offer) @php if ( $offer->offer_code ->delivery_charge_status == 1 ) { $st[] = $offer->offer_code; } else { $st = []; } @endphp @endforeach @if (count($st) > 0)