magento -- 添加中國省份列表
magento本身的數據庫裏不包含中國的省份信息,你可以執行以下的SQL語句來添加
添加到directory_country_region表
INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'GD', '廣東'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'BJ', '北京'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'SH', '上海'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'TJ', '天津'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'HE', '河北'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'SX', '山西'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'NM', '內蒙古'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'LN', '遼寧'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'JL', '吉林'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'HL', '黑龍江'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'JS', '江蘇'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'ZJ', '浙江'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'AH', '安徽'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'FJ', '福建'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'JX', '江西'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'SD', '山東'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'HA', '河南'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'HB', '湖北'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'HN', '湖南'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'GX', '廣西'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'HI', '海南'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'CQ', '重慶'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'SC', '四川'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'GZ', '貴州'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'YN', '雲南'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'XZ', '西藏'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'SN', '陝西'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'GS', '甘肅'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'QH', '青海'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'NX', '寧夏'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'XJ', '新疆'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'HK', '香港'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'AM', '澳門'); INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES (NULL, 'CN', 'TW', '台灣');
添加到directory_country_region_name表
INSERT INTO `directory_country_region_name` (`locale`, `region_id`, `name`) VALUES ('zh_CN', 278, '廣東'), ('zh_CN', 279, '北京'), ('zh_CN', 280, '上海'), ('zh_CN', 281, '天津'), ('zh_CN', 282, '河北'), ('zh_CN', 283, '山西'), ('zh_CN', 284, '內蒙古'), ('zh_CN', 285, '遼寧'), ('zh_CN', 286, '吉林'), ('zh_CN', 287, '黑龍江'), ('zh_CN', 288, '江蘇'), ('zh_CN', 289, '浙江'), ('zh_CN', 290, '安徽'), ('zh_CN', 291, '福建'), ('zh_CN', 292, '江西'), ('zh_CN', 293, '山東'), ('zh_CN', 294, '河南'), ('zh_CN', 295, '湖北'), ('zh_CN', 296, '湖南'), ('zh_CN', 297, '廣西'), ('zh_CN', 298, '海南'), ('zh_CN', 299, '重慶'), ('zh_CN', 300, '四川'), ('zh_CN', 301, '貴州'), ('zh_CN', 302, '雲南'), ('zh_CN', 303, '西藏'), ('zh_CN', 304, '陝西'), ('zh_CN', 305, '甘肅'), ('zh_CN', 306, '青海'), ('zh_CN', 307, '寧夏'), ('zh_CN', 308, '新疆'), ('zh_CN', 309, '香港'), ('zh_CN', 310, '澳門'), ('zh_CN', 311, '台灣');
請注意第二段SQL語句中的region_id跟directory_country_region表的主鍵相關聯,而且directory_country_region_name表中的region_id並不是自增的,以上所寫的從278到311是在directory_country_region隻添加了中國省份所對應的region_id,如果同時添加了其它國家的省份或地區,region_id要做相應改變。
最後更新:2017-04-02 04:26:00
上一篇:
Linux 係統的單用戶模式、修複模式、跨控製台登錄在係統修複中的運用
下一篇:
深入理解ioctl
Android開發7——android.database.CursorIndexOutOfBoundsException:Index -1 requested, with a size of 1
騰訊與華為數據之爭談物聯網大數據發展之困
android利用jdk製作簽名
mongodb刪除表記錄
【Tools】eclipse svn插件離線包安裝問題
數據庫默認端口和驅動總結
IBM WebSphere Application Server V6.1 Fix Pack 37於2011.04.04發布
細節決定網站的用戶和流量
找不到BufferedImage這個Class的解決方法
NYOJ714-Card Trick