Skip to content

Commit

Permalink
MMB-284: Remove date checks from valid membership query
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammad Shahrukh committed Oct 15, 2024
1 parent 1b2db7d commit e0cbaed
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions CRM/Certificate/Service/CertificateMembership.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ private function getValidMembershipsForCertificate(int $certificateId, int $cont

$query = Membership::get(FALSE)
->addSelect('start_date', 'end_date')
->addWhere('contact_id', '=', $contactId)
->addClause('OR', ['start_date', 'IS NULL'], ['start_date', '<=', 'now'])
->addClause('OR', ['end_date', 'IS NULL'], ['end_date', '>', 'now']);
->addWhere('contact_id', '=', $contactId);

if (!empty($certificates[0]['entityTypes'])) {
$query->addWhere('membership_type_id', 'IN', explode(',', $certificates[0]['entityTypes']));
Expand Down

0 comments on commit e0cbaed

Please sign in to comment.