- N +

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

原标题: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;


QQ截图20181205103953.jpg


再次提醒,执行以上sql之前,一定要先备份数据库。以免造成不必要的损失

有好的文章希望我们帮助分享和推广,猛戳这里我要投稿

  • 原文地址:https://www.ocxd.cn
  • 温馨提示:文章内容系作者个人观点,不代表OC小店对观点赞同或支持。
  • 版权声明:本文转载OC小店版权归原作者所有,欢迎分享本文,转载请保留出处!

作者:admin
返回列表
上一篇:
下一篇:

发表评论中国互联网举报中心

快捷回复:

    评论列表 (暂无评论,共4558人参与)参与讨论

    还没有评论,来说两句吧...