Shop-Script 5: удаление заказов.

24 июля 2014

Удаляем "лишние" заказы со статусом "Удалён" из Shop-Script 5:

DELETE FROM shop_order_items WHERE order_id IN (SELECT id FROM shop_order WHERE state_id = 'deleted');
DELETE FROM shop_order_log WHERE order_id IN (SELECT id FROM shop_order WHERE state_id = 'deleted');
DELETE FROM shop_order_log_params WHERE order_id IN (SELECT id FROM shop_order WHERE state_id = 'deleted');
DELETE FROM shop_order_params WHERE order_id IN (SELECT id FROM shop_order WHERE state_id = 'deleted');
DELETE FROM shop_order WHERE state_id = 'deleted';

Написать комментарий