<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
//membership type has reminder day set.
$query = '
- UPDATE civicrm_membership membership
-INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id )
+ UPDATE civicrm_membership membership
+INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id )
INNER JOIN civicrm_membership_type type ON ( type.id = membership.membership_type_id )
- SET membership.reminder_date = DATE_SUB( membership.end_date, INTERVAL type.renewal_reminder_day + 1 DAY )
- WHERE membership.reminder_date IS NULL
+ SET membership.reminder_date = DATE_SUB( membership.end_date, INTERVAL type.renewal_reminder_day + 1 DAY )
+ WHERE membership.reminder_date IS NULL
AND contact.is_deleted = 0
AND ( contact.is_deceased IS NULL OR contact.is_deceased = 0 )
- AND type.renewal_reminder_day IS NOT NULL
+ AND type.renewal_reminder_day IS NOT NULL
AND membership.status_id IN ( ' . implode(' , ', $statusIds) . ' )';
CRM_Core_DAO::executeQuery($query);