diff --git a/bin/process_invite_rewards b/bin/process_invite_rewards index 05f5dbbe3374abc2e0f4cf6dc277abfe76431223..06648d9d0afb5edaa18de7e2f58ebc10ad494a77 100755 --- a/bin/process_invite_rewards +++ b/bin/process_invite_rewards @@ -36,7 +36,7 @@ QUERY = <<~SQL WHERE rewarded_at IS NULL AND used_by_id IS NOT NULL AND amount > 0 GROUP BY used_by_id, code, creator_id, plan_name HAVING - MIN(transactions.created_at) < LOCALTIMESTAMP - '90 days'::interval + MIN(transactions.settled_after) < LOCALTIMESTAMP - '2 days'::interval AND SUM(transactions.amount) >= 15 SQL