bebeboutik-scripts/regeneration_sale_cache.php
2017-12-18 17:14:31 +01:00

27 lines
796 B
PHP

<?php
ini_set('memory_limit', '4096M');
ini_set('max_execution_time', 0);
$_SERVER['HTTP_HOST'] = 'www.bebeboutik.com';
include dirname(__FILE__).'/www/config/config.inc.php';
Db::getInstance()->ExecuteS('
DELETE FROM `'._DB_PREFIX_.'product_ps_cache`
WHERE `id_product` < 5081878
AND `id_product` > 5063468
');
Db::getInstance()->ExecuteS('
INSERT IGNORE INTO `'._DB_PREFIX_.'product_ps_cache` (
SELECT p.id_product, IFNULL(
(
SELECT s.id_sale
FROM `'._DB_PREFIX_.'privatesale_category` s
WHERE s.`id_category` = p.`id_category_default`
LIMIT 1)
, 0
)
FROM `'._DB_PREFIX_.'product` p
WHERE `id_product` < 5081878
AND `id_product` > 5063468
)
');