Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

Fix reserved order being included in exports

Dave Earleyd560a48557b9
diff --git a/backend/app/Repository/Eloquent/AttendeeRepository.php b/backend/app/Repository/Eloquent/AttendeeRepository.php
index 87702d06d..ee84ab3df 100644
--- a/backend/app/Repository/Eloquent/AttendeeRepository.php
+++ b/backend/app/Repository/Eloquent/AttendeeRepository.php
@@ -28,8 +28,13 @@ class AttendeeRepository extends BaseRepository implements AttendeeRepositoryInt
public function findByEventIdForExport(int $eventId): Collection
{
$this->applyConditions([
- 'event_id' => $eventId,
+ 'attendees.event_id' => $eventId,
]);
+
+ $this->model->select('attendees.*');
+ $this->model->join('orders', 'orders.id', '=', 'attendees.order_id');
+ $this->model->whereIn('orders.status', [OrderStatus::COMPLETED->name, OrderStatus::CANCELLED->name]);
+
$model = $this->model->limit(10000)->get();
$this->resetModel();