以下sql查询将更改订单状态:
update wp_posts set post_status = 'wc-completed' where post_type = 'shop_order' and post_status ='wc-processing' ;
如何仅更改特定日期之前的订单的订单状态?
答案 0 :(得分:0)
使用此SQL查询(使之前总是做数据库备份)批量更改日期之前(例如05 OCT 2018
之前)的订单状态:
UPDATE `wp_posts`
SET `post_status` = 'wc-completed'
WHERE `post_type` = 'shop_order'
AND `post_status` ='wc-processing'
AND `post_date` < '2018-10-05 00:00:00';
经测试可正常工作