{"id":60921,"date":"2025-04-26T10:13:38","date_gmt":"2025-04-26T02:13:38","guid":{"rendered":"https:\/\/fwq.ai\/blog\/60921\/"},"modified":"2025-04-26T10:13:38","modified_gmt":"2025-04-26T02:13:38","slug":"zencart%e6%89%b9%e9%87%8f%e6%93%8d%e4%bd%9c%e6%95%b0%e6%8d%ae%e5%ba%93sql%e5%91%bd%e4%bb%a4%e6%b8%85%e7%a9%ba%e4%ba%a7%e5%93%81","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/60921\/","title":{"rendered":"ZenCart\u6279\u91cf\u64cd\u4f5c\u6570\u636e\u5e93SQL\u547d\u4ee4\u6e05\u7a7a\u4ea7\u54c1"},"content":{"rendered":"<p> \u5728\u4f7f\u7528zen cart\u8fc7\u7a0b\u4e2d,\u6709\u5f88\u591a\u8981\u6d89\u53ca\u5230\u6279\u91cf\u4fee\u6539\u7684\u4e1c\u897f, \u5982\u679c\u5728\u540e\u53f0\u4e00\u4e2a\u4e2a\u6765\u624b\u52a8\u4fee\u6539\u5b9e\u5728\u9ebb\u70e6,\u6240\u4ee5\u6211\u4eec\u5fc5\u9700\u901a\u8fc7SQL\u6279\u91cf\u547d\u4ee4\u6765\u4fee\u6539,\u8fd9\u4e48\u8981\u51cf\u5c11\u5f88\u591a\u9ebb\u70e6. \u4e0b\u9762\u6574\u7406\u4e86\u4e00\u4e9bSQL\u6279\u91cf\u547d\u4ee4,\u5e0c\u671b\u5bf9\u5927\u5bb6\u6709\u7528.<br \/> \u4e00 \u6279\u91cf\u5220\u9664\u5168\u90e8\u5546\u54c1\u7b49\u6570\u636e<\/p>\n<pre>\r\n# \u6e05\u7a7a\u5546\u54c1\u5206\u7c7b\u3001\u5546\u54c1\u3001\u5c5e\u6027\r\nTRUNCATE TABLE categories;\r\nTRUNCATE TABLE categories_description;\r\n\r\n# \u6e05\u7a7a\u5546\u54c1\u4ee5\u53ca\u5c5e\u6027\r\nTRUNCATE TABLE media_clips;\r\nTRUNCATE TABLE media_manager;\r\nTRUNCATE TABLE media_to_products;\r\nTRUNCATE TABLE media_types;\r\nTRUNCATE TABLE music_genre;\r\nTRUNCATE TABLE product_music_extra;\r\nTRUNCATE TABLE product_types_to_category;\r\nTRUNCATE TABLE products;\r\nTRUNCATE TABLE products_attributes;\r\nTRUNCATE TABLE products_attributes_download;\r\nTRUNCATE TABLE products_description;\r\nTRUNCATE TABLE products_discount_quantity;\r\nTRUNCATE TABLE products_notifications;\r\nTRUNCATE TABLE products_options;\r\nTRUNCATE TABLE products_options_values;\r\nTRUNCATE TABLE products_options_values_to_products_options;\r\nTRUNCATE TABLE products_to_categories;\r\nTRUNCATE TABLE record_artists;\r\nTRUNCATE TABLE record_artists_info;\r\nTRUNCATE TABLE record_company;\r\nTRUNCATE TABLE record_company_info;\r\n\r\n# \u6e05\u7a7a\u63a8\u8350\u5546\u54c1\r\nTRUNCATE TABLE featured;\r\n\r\n# \u6e05\u7a7a\u4fc3\u9500\u5546\u54c1\r\nTRUNCATE TABLE salemaker_sales;\r\n\r\n# \u6e05\u7a7a\u7279\u4ef7\u5546\u54c1\r\nTRUNCATE TABLE specials;\r\n\r\n# \u6e05\u7a7a\u56e2\u4f53\u4ef7\u683c\r\nTRUNCATE TABLE group_pricing;\r\n\r\n# \u6e05\u7a7a\u5382\u5bb6\u53ca\u8d44\u6599\r\nTRUNCATE TABLE manufacturers;\r\nTRUNCATE TABLE manufacturers_info;\r\n\r\n# \u6e05\u7a7a\u5ba2\u6237\u8bc4\u8bba\r\nTRUNCATE TABLE reviews;\r\nTRUNCATE TABLE reviews_description;\r\n\r\n#\u6e05\u7a7a\u524d\u53f0\u6ce8\u518c\u7528\u6237 \u8ba2\u5355 \u5386\u53f2\u8ba2\u5355\u7b49\u4fe1\u606f \u614e\u7528\r\nTRUNCATE TABLE `address_book`;\r\nTRUNCATE TABLE `admin_activity_log`;\r\nTRUNCATE TABLE `counter`;\r\nTRUNCATE TABLE `counter_history`;\r\nTRUNCATE TABLE `customers`;\r\nTRUNCATE TABLE `customers_basket`;\r\nTRUNCATE TABLE `customers_info`;\r\nTRUNCATE TABLE `orders`;\r\nTRUNCATE TABLE `orders_products`;\r\nTRUNCATE TABLE `orders_status_history`;\r\nTRUNCATE TABLE `orders_total`;\r\nTRUNCATE TABLE `paypal`;\r\nTRUNCATE TABLE `paypal_payment_status_history`;\r\nTRUNCATE TABLE `paypal_session`;\r\nupdate `products_description` set `products_viewed` = '0' WHERE `products_viewed` &amp;gt; '0';\r\nupdate `products` set `products_ordered` = '0' WHERE `products_ordered` &amp;gt; '0';<\/pre>\n<p> \u4e8c \u6279\u91cf\u53d8\u66f4\u5546\u54c1\u90e8\u5206\u5c5e\u6027<\/p>\n<pre>\r\n#\u6279\u91cf\u8bbe\u7f6e\u7279\u4ef7\u5546\u54c1\u8d77\u59cb\u65f6\u95f4, \u5176\u4e2d 0001-01-01 \u4e3a \u65e0\u8d77\u59cb\u65f6\u95f4\r\nUPDATE specials SET specials_date_available ='0001-01-01';\r\n\r\n#\u6279\u91cf\u8bbe\u7f6e\u7279\u4ef7\u5546\u54c1\u5230\u671f\u65f6\u95f4 \u5176\u4e2d 2020-12-31 \u4e3a\u5230\u671f\u65f6\u95f4\r\nUPDATE specials SET expires_date ='2020-12-31';\r\n\r\n#\u6279\u91cf\u5f00\u542f\u7279\u4ef7\u5546\u54c1\r\nUPDATE specials SET status ='1';\r\n\r\n#\u6279\u91cf\u5173\u95ed\u7279\u4ef7\u5546\u54c1\r\nUPDATE specials SET status ='0';\r\n\r\n#\u6279\u91cf\u8bbe\u7f6e\u5168\u7ad9\u5546\u54c1\u514d\u8fd0\u8d39\r\nUPDATE products SET product_is_always_free_shipping = '1';\r\n\r\n#\u6279\u91cf\u66f4\u6539\u5546\u54c1\u6dfb\u52a0\u65f6\u95f4 \u5176\u4e2d 2011-10-01 \u4e3a\u6dfb\u52a0\u65f6\u671f\r\nUPDATE products SET products_date_added = '2011-10-01';\r\n\r\n#\u6279\u91cf\u66f4\u6539\u5546\u54c1\u91cd\u91cf \u5176\u4e2d 500 \u4e3a\u91cd\u91cf\u503c\r\nUPDATE products SET products_weight = '500';\r\n\r\n#\u6279\u91cf\u8bbe\u7f6e\u5e93\u5b58\u6570\u91cf \u5176\u4e2d 99 \u4e3a\u5e93\u5b58\u6570\u91cf\r\nUPDATE `products` SET `products_quantity` = '99';\r\n\r\n#\u6279\u91cf\u8bbe\u7f6e\u7279\u4ef7\uff0c\u5176\u4e2d +11.55 \u6307\u7684\u662f\u589e\u52a0 11.55\uff0c\u5982\u679c\u662f\u51cf\u5c11\u5c31\u662f -11.55\r\nUPDATE specials SET specials_new_products_price=specials_new_products_price+11.55;\r\nUPDATE products p,specials s SET p.products_price_sorter = s.specials_new_products_price WHERE p.products_id = s.products_id;\r\n\r\n#\u6279\u91cf\u8bbe\u7f6e\u539f\u4ef7\uff0c\u5176\u4e2d +22.66 \u6307\u7684\u662f\u589e\u52a0 22.66\uff0c\u5982\u679c\u662f\u51cf\u5c11\u5c31\u662f -22.66\r\nUPDATE `products` SET `products_price`=`products_price`+22.66;\r\n\r\n#\u6279\u91cf\u66ff\u6362\u5546\u54c1\u63cf\u8ff0\u6307\u5b9a\u5b57\u7b26\r\nupdate products_description set products_description=replace(products_description,'\u8fd9\u91cc\u8f93\u5165\u8981\u66ff\u6362\u7684\u5b57\u7b26','')<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4f7f\u7528zen cart\u8fc7\u7a0b\u4e2d,\u6709\u5f88\u591a\u8981\u6d89\u53ca\u5230\u6279\u91cf\u4fee\u6539\u7684\u4e1c\u897f, \u5982\u679c\u5728\u540e\u53f0\u4e00\u4e2a\u4e2a\u6765\u624b\u52a8\u4fee\u6539\u5b9e\u5728\u9ebb\u70e6,\u6240\u4ee5\u6211\u4eec\u5fc5\u9700\u901a\u8fc7SQL\u6279\u91cf\u547d\u4ee4\u6765\u4fee\u6539,\u8fd9\u4e48\u8981\u51cf\u5c11\u5f88\u591a\u9ebb\u70e6. \u4e0b\u9762\u6574\u7406\u4e86\u4e00\u4e9bSQL\u6279\u91cf\u547d\u4ee4,\u5e0c\u671b\u5bf9\u5927\u5bb6\u6709\u7528. \u4e00 \u6279\u91cf\u5220\u9664\u5168\u90e8\u5546\u54c1\u7b49\u6570\u636e # \u6e05\u7a7a\u5546\u54c1\u5206\u7c7b\u3001\u5546\u54c1\u3001\u5c5e\u6027 TRUNCATE TABLE categories; TRUNCATE TABLE categories_description; # \u6e05\u7a7a\u5546\u54c1\u4ee5\u53ca\u5c5e\u6027 TRUNCATE TABLE media_clips; TRUNCATE TABLE media_manager; TRUNCATE TABLE media_to_products; TRUNCATE TABLE media_types; TRUNCATE TABLE music_genre; TRUNCATE TABLE product_music_extra; TRUNCATE TABLE product_types_to_category; TRUNCATE TABLE products; TRUNCATE TABLE products_attributes; TRUNCATE TABLE products_attributes_download; TRUNCATE TABLE products_description; TRUNCATE TABLE products_discount_quantity; TRUNCATE TABLE products_notifications; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-60921","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60921","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=60921"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/60921\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=60921"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=60921"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=60921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}