diff --git a/app/Helpers/helpers.php b/app/Helpers/helpers.php index 2a61dedb..89714dd2 100644 --- a/app/Helpers/helpers.php +++ b/app/Helpers/helpers.php @@ -75,8 +75,15 @@ if(!function_exists('organisers')){ } if(!function_exists('zanitlananlar')){ function zanitlananlar($ticket){ - $reserved = $ticket->reserved->pluck('seat_no')->crossJoin(['reserved']); - $booked = $ticket->booked->pluck('booked','seat_no')->dump(); + $reserved = $ticket->reserved->pluck('seat_no') + ->transform(function ($item,$key){ + return [$item => 'reserved']; + }); + $booked = $ticket->booked->pluck('seat_no') + ->transform(function ($item,$key){ + return [$item =>'booked']; + }); + return $booked->union($reserved)->toJson(); } } diff --git a/app/Http/Controllers/EventCheckoutController.php b/app/Http/Controllers/EventCheckoutController.php index 27d57123..25797984 100644 --- a/app/Http/Controllers/EventCheckoutController.php +++ b/app/Http/Controllers/EventCheckoutController.php @@ -66,7 +66,7 @@ class EventCheckoutController extends Controller // ]); // } $event = Event::with('venue')->findOrFail($event_id); - $tickets = Ticket::with(['section','reserved:seat_no,ticket_id','booked:id,seat_no,ticket_id']) + $tickets = Ticket::with(['section','reserved:seat_no,ticket_id','booked:seat_no,ticket_id']) ->where('event_id',$event_id) ->where('ticket_date',$request->get('ticket_date')) ->where('is_hidden', false) diff --git a/app/Models/Ticket.php b/app/Models/Ticket.php index a5eb91f5..74ec1c4e 100644 --- a/app/Models/Ticket.php +++ b/app/Models/Ticket.php @@ -265,7 +265,7 @@ class Ticket extends MyBaseModel return config('attendize.ticket_status_sold_out'); } - if ($this->event->start_date->lte(Carbon::now())) { + if ($this->event->end_date->lte(Carbon::now())) { return config('attendize.ticket_status_off_sale'); } diff --git a/database/seeds/TicketStatusSeeder.php b/database/seeds/TicketStatusSeeder.php index c6ddfb8c..737c7df0 100644 --- a/database/seeds/TicketStatusSeeder.php +++ b/database/seeds/TicketStatusSeeder.php @@ -30,7 +30,7 @@ class TicketStatusSeeder extends Seeder ], [ 'id' => 5, - 'name' => 'On Sale', + 'name' => 'Off Sale', ], ]; Schema::disableForeignKeyConstraints(); diff --git a/resources/views/Bilettm/ViewEvent/EventPage.blade.php b/resources/views/Bilettm/ViewEvent/EventPage.blade.php index 414483d6..9196f546 100644 --- a/resources/views/Bilettm/ViewEvent/EventPage.blade.php +++ b/resources/views/Bilettm/ViewEvent/EventPage.blade.php @@ -4,7 +4,9 @@ - + @if($event->images->count()) + + @endif @endsection diff --git a/resources/views/Bilettm/ViewEvent/SeatsPage.blade.php b/resources/views/Bilettm/ViewEvent/SeatsPage.blade.php index 06f8c34e..5e81449e 100644 --- a/resources/views/Bilettm/ViewEvent/SeatsPage.blade.php +++ b/resources/views/Bilettm/ViewEvent/SeatsPage.blade.php @@ -45,45 +45,60 @@
@foreach($tickets as $ticket)
+ +
- {{$event->venue->venue_name}} - {{$ticket->section->section_no}}
-
-
{{$ticket->title }} {{$ticket->description}} {{$ticket->section->section_no}}
- - - @foreach($ticket->section->seats as $row) - - - - - @for($i = $row['start_no'];$i<=$row['end_no'];$i++) - - @endfor - - - @endforeach -
{{$row['row']}} - - -
- -
+ @if($ticket->is_paused) +

@lang("Public_ViewEvent.currently_not_on_sale")

+ @else + @if($ticket->sale_status === config('attendize.ticket_status_sold_out')) + + @lang("Public_ViewEvent.sold_out") + + @elseif($ticket->sale_status === config('attendize.ticket_status_after_sale_date')) + @lang("Public_ViewEvent.sales_have_ended") + @else + +
+
{{$ticket->title }} {{$ticket->section->section_no}} {{$ticket->section->description}}
+ + + @foreach($ticket->section->seats as $row) + + + + + @for($i = $row['start_no'];$i<=$row['end_no'];$i++) + + @endfor + + + @endforeach +
{{$row['row']}} + + +
+ +
+ + @endif + @endif +
- @endforeach
@@ -104,39 +119,53 @@ @section('after_scripts')