Show purchased tickets in /mon-compte billets tab
- Load user's BilletOrders via BilletBuyer orders - Display each ticket with: name, status badge (Actif/Expire/Annule), first scan date, event info (name, date, address), reference, order number, price, download PDF and view order buttons Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Billet;
|
||||
use App\Entity\BilletBuyer;
|
||||
use App\Entity\BilletDesign;
|
||||
use App\Entity\BilletOrder;
|
||||
use App\Entity\Category;
|
||||
use App\Entity\Event;
|
||||
use App\Entity\Payout;
|
||||
@@ -66,12 +68,27 @@ class AccountController extends AbstractController
|
||||
$events = $paginator->paginate($eventsQuery, $request->query->getInt('page', 1), 10);
|
||||
}
|
||||
|
||||
$orders = $em->getRepository(BilletBuyer::class)->findBy(
|
||||
['user' => $user],
|
||||
['createdAt' => 'DESC'],
|
||||
);
|
||||
|
||||
$userTickets = [];
|
||||
foreach ($orders as $order) {
|
||||
$tickets = $em->getRepository(BilletOrder::class)->findBy(['billetBuyer' => $order]);
|
||||
foreach ($tickets as $ticket) {
|
||||
$userTickets[] = $ticket;
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render('account/index.html.twig', [
|
||||
'tab' => $tab,
|
||||
'isOrganizer' => $isOrganizer,
|
||||
'payouts' => $payouts,
|
||||
'subAccounts' => $subAccounts,
|
||||
'events' => $events,
|
||||
'orders' => $orders,
|
||||
'userTickets' => $userTickets,
|
||||
'breadcrumbs' => [
|
||||
self::BREADCRUMB_HOME,
|
||||
self::BREADCRUMB_ACCOUNT,
|
||||
|
||||
Reference in New Issue
Block a user