zencart+magento 如何清空商品演示数据和没有商品数据的sql执行语句

 

#清空商品商品、属性、分类
TRUNCATE TABLE categories;
TRUNCATE TABLE categories_description;
TRUNCATE TABLE products_to_categories;

TRUNCATE TABLE reviews;

TRUNCATE TABLE reviews_description;

TRUNCATE TABLE meta_tags_categories_description;

TRUNCATE TABLE meta_tags_products_description;

# 清空商品和属性
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;
TRUNCATE TABLE products_options;
TRUNCATE TABLE products_options_types;
TRUNCATE TABLE products_options_values;
TRUNCATE TABLE products_options_values_to_products_options;
TRUNCATE TABLE products_to_categories;
TRUNCATE TABLE record_artists;
TRUNCATE TABLE record_artists_info;
TRUNCATE TABLE record_company;
TRUNCATE TABLE record_company_info;

# 清空客户评论
TRUNCATE TABLE reviews;
TRUNCATE TABLE reviews_description;

# 清空推荐商品
TRUNCATE TABLE featured;

# 清空厂家及资料
TRUNCATE TABLE manufacturers;
TRUNCATE TABLE manufacturers_info;

# 清空团体价格
TRUNCATE TABLE group_pricing;

# 清空促销商品
TRUNCATE TABLE salemaker_sales;

# 清空特价商品
TRUNCATE TABLE specials;

=================================结束=======================

========================================================

 UPDATE  `products` SET  `metatags_title_status` =  '1';  # 解决属性导入导致产品title 状态不显示

========================================================

 UPDATE products_description SET products_description = NULL; # 清空产品描述
========================================================
# 清空编号为64和96的目录下的所有产品
大目录(指包含子目录):

DELETE cd,ptc FROM categories_description cd,categories c,products_to_categories ptc WHERE cd.categories_id = c.categories_id and ptc.categories_id = c.categories_id and c.parent_id in(64,96);
DELETE p,s,pd,c FROM products p ,specials s,products_description pd,categories c WHERE p.products_id=s.specials_id AND p.products_id=pd.products_id AND p.master_categories_id = c.categories_id and c.parent_id in(64,96);

------------------------------------------------------------
子目录:
DELETE FROM categories WHERE categories_id in(64,96);
DELETE FROM categories_description WHERE categories_id in(64,96);
DELETE FROM products_to_categories WHERE categories_id in(64,96);
DELETE FROM meta_tags_categories_description WHERE categories_id in(64,96);
DELETE p,s,pd FROM products p ,specials s,products_description pd WHERE p.products_id=s.specials_id AND p.products_id=pd.products_id  AND p.master_categories_id in(64,96); 
========================================================
包含关键词的产品下架:
UPDATE`products_description`,`products`SET`products`.`products_status`='0' WHERE`products_description`.`products_id`=`products`.`products_id`AND`products_description`.`products_name`LIKE"%GUCC%";
========================================================
网站换域名步骤及注意:
1.服务器账号换过去后能打开,用replace.php批量更换域名,可能本地有php静态文件
2.检查通道是不是新的,./paymentcopy.php 单个更新通道文件,然后提交通道,第二天记得注册付款测试。
========================================================

4.修改价格:
update specials set specials_new_products_price=specials_new_products_price-20;#整体减
UPDATE specials set specials_new_products_price=specials_new_products_price-40 where specials_new_products_price>275;#限定价格整体减
update `specials` set `specials_new_products_price`=77.08 where ` specials_new_products_price ` = 67.78;#限定价格替换

3.替换名称
目录的@update `categories_description` SET `categories_name` = replace (`categories_name`,'ù','ù');
产品的@update products_description set products_name=replace(products_name,'Sunglasses','Sonnenbrillen');#全部替换
描述的@UPDATE `products_description` SET `products_description` = replace (`products_description`,'127.0.0.1','www.jackeneurope.net');

UPDATE products_description set products_description.products_name = concat(products_description.products_name, '[ODM(Original design manufacturer)]');#产品名全都添加后缀

UPDATE products_description set products_description.products_name = concat('2014 scarpe ', products_description.products_name);#产品名全都添加前缀

5.特价过期时间设置
update specials set expires_date=replace(expires_date ,'1970-01-01','2022-12-22')

========================================================

categories.php要开  reset 后要开拿个layoutbox

UPDATE`layout_boxes`SET`layout_box_status`='1' WHERE`layout_box_name`='categories.php.php';

UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='banner_box.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='banner_box2.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='banner_box_all.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='best_sellers.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='currencies.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='document_categories.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='ezpages.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='featured.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='information.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='languages.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='manufacturer_info.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='manufacturers.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='more_information.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='music_genres.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='order_history.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='product_notifications.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='record_companies.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='reviews.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='search.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='search_header.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='shopping_cart.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='specials.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='whats_new.php';
UPDATE`layout_boxes`SET`layout_box_status`='0' WHERE`layout_box_name`='whos_online.php';

---------------------------------------------------------------------------------------------------------------------

mysql 删除指定目录数据:
DELETE FROM categories WHERE categories_id in(72,74,76,78,80,82);
DELETE FROM categories_description WHERE categories_id in(72,74,76,78,80,82);
DELETE FROM products_to_categories WHERE categories_id in(72,74,76,78,80,82);
DELETE FROM meta_tags_categories_description WHERE categories_id in(72,74,76,78,80,82);
DELETE p,pd FROM products p ,products_description pd WHERE p.products_id=pd.products_id AND p.master_categories_id in (72,74,76,78,80,82);


----------------------------------------------

UPDATE products SET products_family = master_categories_id; # 1.51导出相关产品的

========================magento=========================

TRUNCATE TABLE `catalog_product_bundle_option`;
TRUNCATE TABLE `catalog_product_bundle_option_value`;
TRUNCATE TABLE `catalog_product_bundle_selection`;
TRUNCATE TABLE `catalog_product_entity_datetime`;
TRUNCATE TABLE `catalog_product_entity_decimal`;
TRUNCATE TABLE `catalog_product_entity_gallery`;
TRUNCATE TABLE `catalog_product_entity_int`;
TRUNCATE TABLE `catalog_product_entity_media_gallery`;
TRUNCATE TABLE `catalog_product_entity_media_gallery_value`;
TRUNCATE TABLE `catalog_product_entity_text`;
TRUNCATE TABLE `catalog_product_entity_tier_price`;
TRUNCATE TABLE `catalog_product_entity_varchar`;
TRUNCATE TABLE `catalog_product_link`;
TRUNCATE TABLE `catalog_product_link_attribute`;
TRUNCATE TABLE `catalog_product_link_attribute_decimal`;
TRUNCATE TABLE `catalog_product_link_attribute_int`;
TRUNCATE TABLE `catalog_product_link_attribute_varchar`;
TRUNCATE TABLE `catalog_product_link_type`;
TRUNCATE TABLE `catalog_product_option`;
TRUNCATE TABLE `catalog_product_option_price`;
TRUNCATE TABLE `catalog_product_option_title`;
TRUNCATE TABLE `catalog_product_option_type_price`;
TRUNCATE TABLE `catalog_product_option_type_title`;
TRUNCATE TABLE `catalog_product_option_type_value`;
TRUNCATE TABLE `catalog_product_super_attribute`;
TRUNCATE TABLE `catalog_product_super_attribute_label`;
TRUNCATE TABLE `catalog_product_super_attribute_pricing`;
TRUNCATE TABLE `catalog_product_super_link`;
TRUNCATE TABLE `catalog_product_enabled_index`;
TRUNCATE TABLE `catalog_product_website`;
TRUNCATE TABLE `catalog_product_entity`;
TRUNCATE TABLE `cataloginventory_stock`;
TRUNCATE TABLE `cataloginventory_stock_item`;
TRUNCATE TABLE `cataloginventory_stock_status`;

 

-------------------------------------------------------------------------------------------------------------

INSERT INTO configuration

VALUES

(NULL, 'Homepage title', 'HOME_PAGE_TITLE', '', 'set the home page title', 1,210, NOW(), NOW(), NULL, NULL),

(NULL, 'Homepage keywords', 'HOME_PAGE_META_KEYWORDS', '', 'set the home page keywords', 1,211, NOW(), NOW(), NULL, NULL),
(NULL, 'Homepage description', 'HOME_PAGE_META_DESCRIPTION', '', 'set the home page description', 1,212, NOW(), NOW(), NULL, NULL);

(NULL , 'TITLE', 'TITLE', '', 'TITLE',  '1', '213', NOW() , NOW(), NULL , NULL ),

(NULL , 'SITE_TAGLINE', 'SITE_TAGLINE', '', 'SITE_TAGLINE', '1', '214', NOW() , NOW(), NULL , NULL ),

(NULL , 'HEADER_ALT_TEXT图片alt', 'HEADER_ALT_TEXT', '', 'HEADER_ALT_TEXT', '1', '217', NOW() , NOW(), NULL , NULL );

 

 

AmazingCounters.com
posted @ 2013-05-21 08:53  也许明天  阅读(1399)  评论(31编辑  收藏  举报