31 lines
961 B
PHP
31 lines
961 B
PHP
<?php
|
|
// --------------------------------------------------------------------------- //
|
|
// update-investigation-tests.php
|
|
// --------------------------------------------------------------------------- //
|
|
define( 'NDEBUG', '0');
|
|
define('VERSION', '1.0');
|
|
require_once realpath(dirname(__FILE__).'/../../config/prepend.php');
|
|
require_once 'credit-data/v1/index.php';
|
|
|
|
$date = date('Y-m-d H:i:s');
|
|
$orders = Doctrine_Query::create()
|
|
->from('Orders')
|
|
->where('OrderStatus = ?', 'Pending')
|
|
->fetchArray();
|
|
foreach ($orders as $o) {
|
|
if ($date < $o['DueDateTime']) {
|
|
continue;
|
|
}
|
|
$q = Doctrine_Query::create()
|
|
->from('Orders')
|
|
->where('ProviderOrderId = ?', $o['ProviderOrderId'])
|
|
->fetchOne();
|
|
|
|
$q->DataSet = serialize(getDataSet($q->CompanyId, $q->DataSetType));
|
|
$q->OrderStatus = 'Completed';
|
|
$q->DateTimeCompleted = $date;
|
|
$q->save();
|
|
print 'order '.$q->ProviderOrderId." updated\n";
|
|
}
|
|
?>
|