-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcron_cancel_vt.php
29 lines (25 loc) · 978 Bytes
/
cron_cancel_vt.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/../../init.php');
$sql = 'SELECT id_order FROM '._DB_PREFIX_.'orders WHERE current_state = (SELECT id_order_state FROM '._DB_PREFIX_.'order_state WHERE module_name = "midtranspay") AND date_add < TIMESTAMPADD(MINUTE,(12*60)-15,now())';
$results = Db::getInstance()->ExecuteS($sql);
if (!$results)
{
error_log('result null');
}
else
{
foreach ($results as $row)
{
$history = new OrderHistory();
$history->id_order = $row['id_order'];
$order_id_notif = $row['id_order'];
$history->changeIdOrderState( Configuration::get('PS_OS_CANCELED'), $order_id_notif);
$history->addWithemail(true);
/*$sql2 = " INSERT INTO "._DB_PREFIX_."order_history (id_employee,id_order,id_order_state,date_add)
VALUES ('0','".$row['id_order']."','".Configuration::get('PS_OS_CANCELED')."',TIMESTAMPADD(MINUTE,(12*60),now()))
";
Db::getInstance()->Execute($sql2);*/
}
}
?>