fix(premium-podcasts): update query to validate subscription

This commit is contained in:
Yassine Doghri 2024-07-30 10:59:47 +00:00
parent 37ee6d35b4
commit 2b1bbf3430

View File

@ -116,11 +116,13 @@ class SubscriptionModel extends Model
return $subscriptionModel return $subscriptionModel
->where([ ->where([
'token' => hash('sha256', $token), 'token' => hash('sha256', $token),
'status' => 'active', 'status' => 'active',
'expires_at' => null,
]) ])
->groupStart()
->where('expires_at', null)
->orWhere('`expires_at` > UTC_TIMESTAMP()', null, false) ->orWhere('`expires_at` > UTC_TIMESTAMP()', null, false)
->groupEnd()
->first(); ->first();
} }