From 914ce02d2c620cd83431adf1acfd9df755e412b2 Mon Sep 17 00:00:00 2001 From: Edmond Lang Date: Wed, 3 Dec 2025 10:46:31 +0800 Subject: [PATCH] update affiliate program --- .../Modules/Affiliate/Services/TracksAffiliateOrder.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Classes/Modules/Affiliate/Services/TracksAffiliateOrder.php b/app/Classes/Modules/Affiliate/Services/TracksAffiliateOrder.php index b45413a4..b6f81dc7 100644 --- a/app/Classes/Modules/Affiliate/Services/TracksAffiliateOrder.php +++ b/app/Classes/Modules/Affiliate/Services/TracksAffiliateOrder.php @@ -49,7 +49,11 @@ class TracksAffiliateOrder // We'll use a KeyValuePair to track which bookings have been counted $kvpKey = 'affiliate_order_tracked_' . $affiliate->id; - if ($booking->hasAttribute($kvpKey)) { + $existingKvp = $booking->attributesKVP() + ->where('key', $kvpKey) + ->exists(); + + if ($existingKvp) { return $affiliate; // Already counted }