fix cron to send articles to philea
This commit is contained in:
parent
c1fcfb5f85
commit
31d77b1d60
@ -5,6 +5,13 @@ include dirname(__FILE__).'/../../config/config.inc.php';
|
|||||||
if(isset($_SERVER['REMOTE_ADDR'])) {
|
if(isset($_SERVER['REMOTE_ADDR'])) {
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
// CHECKING RUNNING OF CRON_SALE_CACHE
|
||||||
|
$fileName = 'cron_sale_cache.php';
|
||||||
|
$output = shell_exec("ps -ax | grep $fileName | wc -l");
|
||||||
|
if($output > 2){
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
set_time_limit(600);
|
set_time_limit(600);
|
||||||
if($row = Db::getInstance()->getRow('
|
if($row = Db::getInstance()->getRow('
|
||||||
SELECT *
|
SELECT *
|
||||||
@ -12,6 +19,13 @@ if($row = Db::getInstance()->getRow('
|
|||||||
WHERE `status` = 0
|
WHERE `status` = 0
|
||||||
ORDER BY `date_add` ASC
|
ORDER BY `date_add` ASC
|
||||||
')) {
|
')) {
|
||||||
|
// CHECKING ASSOCIATED PRODUCTS
|
||||||
|
$associated_products = Db::getInstance()->getValue('
|
||||||
|
SELECT COUNT(`id_sale`)
|
||||||
|
FROM `'._DB_PREFIX_.'product_ps_cache`
|
||||||
|
WHERE `id_sale` = '.(int) $row['id_sale'].'
|
||||||
|
');
|
||||||
|
if($associated_products > 0) {
|
||||||
// SEND ART01
|
// SEND ART01
|
||||||
Db::getInstance()->ExecuteS('
|
Db::getInstance()->ExecuteS('
|
||||||
UPDATE `'._DB_PREFIX_.'philea_sync`
|
UPDATE `'._DB_PREFIX_.'philea_sync`
|
||||||
@ -30,6 +44,7 @@ if($row = Db::getInstance()->getRow('
|
|||||||
LIMIT 1
|
LIMIT 1
|
||||||
');
|
');
|
||||||
/*system('cd '.dirname(__FILE__).'/script && php send_recep_orderform.php '.(int) $row['id_sale']);*/
|
/*system('cd '.dirname(__FILE__).'/script && php send_recep_orderform.php '.(int) $row['id_sale']);*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($row = Db::getInstance()->getRow('
|
if($row = Db::getInstance()->getRow('
|
||||||
|
Loading…
Reference in New Issue
Block a user