Skip to content

Instantly share code, notes, and snippets.

@dbarbar
Last active December 24, 2015 00:39
Show Gist options
  • Save dbarbar/6718236 to your computer and use it in GitHub Desktop.
Save dbarbar/6718236 to your computer and use it in GitHub Desktop.
<?php
$results = db_query("SELECT order_id, next_charge FROM {fundraiser_recurring} WHERE FROM_UNIXTIME(next_charge) > NOW() and gateway_resp IS NULL");
$count = 0;
while ($row = db_fetch_object($results)) {
$replacements = array('!date' => date('n/j/Y', $row->next_charge));
uc_order_comment_save($row->order_id, 0, t('This order is scheduled to process on !date.', $replacements), 'admin');
drush_print('Added comment to order ' . $row->order_id . ' with next_charge ' . $row->next_charge);
$count++;
}
drush_print('Affected ' . $count . ' rows.');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment