opencart 删除用户、订单、商品等信息的方法

有时候遇到这种情况,需要清空会员、商品、订单等数据。 如果在后台一条一条删除,就显得很慢了。如何快速删除数据?当然是直接操作数据库了。但是有的表关联比较多,可能会错误的删除表。这里我把sql贴出来,方便新手参考。操作数据库之前一定要记住备份,备份,备份(重要的事情说三遍)
一、删除会员

TRUNCATE TABLE oc_customer;
TRUNCATE TABLE oc_customer_activity;
TRUNCATE TABLE oc_customer_affiliate;
TRUNCATE TABLE oc_customer_affiliate_report;
TRUNCATE TABLE oc_customer_approval;
TRUNCATE TABLE oc_customer_history;
TRUNCATE TABLE oc_customer_ip;
TRUNCATE TABLE oc_customer_login;
TRUNCATE TABLE oc_customer_online;
TRUNCATE TABLE oc_customer_reward;
TRUNCATE TABLE oc_customer_search;
TRUNCATE TABLE oc_customer_transaction;
TRUNCATE TABLE oc_customer_wishlist;
TRUNCATE TABLE oc_address;

二、删除订单

TRUNCATE TABLE oc_order;
TRUNCATE TABLE oc_order_custom_field;
TRUNCATE TABLE oc_order_history;
TRUNCATE TABLE oc_order_option;
TRUNCATE TABLE oc_order_product;
TRUNCATE TABLE oc_order_recurring;
TRUNCATE TABLE oc_order_recurring_transaction;
TRUNCATE TABLE oc_order_total;
TRUNCATE TABLE oc_order_voucher;
TRUNCATE TABLE oc_cart;

三、删除商品

TRUNCATE TABLE oc_coupon_product;
TRUNCATE TABLE oc_product;
TRUNCATE TABLE oc_product_attribute;
TRUNCATE TABLE oc_product_description;
TRUNCATE TABLE oc_product_discount;
TRUNCATE TABLE oc_product_filter;
TRUNCATE TABLE oc_product_image;
TRUNCATE TABLE oc_product_option;
TRUNCATE TABLE oc_product_option_value;
TRUNCATE TABLE oc_product_recurring;
TRUNCATE TABLE oc_product_related;
TRUNCATE TABLE oc_product_reward;
TRUNCATE TABLE oc_product_special;
TRUNCATE TABLE oc_product_to_category;
TRUNCATE TABLE oc_product_to_download;
TRUNCATE TABLE oc_product_to_layout;
TRUNCATE TABLE oc_product_to_store;
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容