· 3 years ago · Oct 16, 2021, 03:02 AM
1CREATE TABLE `ghtk_shops` (
2 `id` char(36) COLLATE utf8_unicode_ci NOT NULL,
3 `order` int(11) unsigned NOT NULL AUTO_INCREMENT,
4 `code` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
5 `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
6 `first_address` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
7 `email` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
8 `password` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
9 `tel` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
10 `created_user_id` int(11) unsigned DEFAULT NULL,
11 `created_username` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'denormalized',
12 `modified_user_id` int(10) unsigned DEFAULT NULL,
13 `modified_username` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'denormalized',
14 `shop_status_id` int(11) unsigned NOT NULL,
15 `province_id` int(10) unsigned DEFAULT NULL,
16 `district_id` int(10) unsigned DEFAULT NULL,
17 `street_id` int(10) unsigned DEFAULT NULL,
18 `ward_id` int(10) unsigned DEFAULT NULL,
19 `hamlet_id` int(11) DEFAULT '0',
20 `last_address` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'denormalized',
21 `shop_type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '0: standard, 1: pro, 2: vip, 3:Pre, 4: Th? báo',
22 `pick_product_fullname` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
23 `pick_product_province_id` int(10) unsigned DEFAULT NULL,
24 `pick_product_district_id` int(10) unsigned DEFAULT NULL,
25 `pick_product_street_id` int(10) unsigned DEFAULT NULL,
26 `pick_product_ward_id` int(10) unsigned DEFAULT NULL,
27 `pick_product_first_address` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
28 `pick_product_last_address` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'denormalized',
29 `pick_product_tel` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL,
30 `against_fullname` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
31 `against_tel` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
32 `against_email` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
33 `against_bank_own` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
34 `against_bank_account` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
35 `against_bank_name` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
36 `against_bank_brand` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
37 `chuyen_tinh` int(11) DEFAULT NULL,
38 `ship_money_by_weight` tinyint(3) unsigned DEFAULT '0',
39 `chunk_weight` int(10) unsigned DEFAULT '0' COMMENT 'chunk of weight for calculating the ship fee',
40 `fee_by_weight` int(10) unsigned DEFAULT '20000' COMMENT 'fee by weight',
41 `next_fee_by_weight` int(11) unsigned DEFAULT '5000' COMMENT 'next fee level by weight',
42 `can_import` tinyint(3) unsigned DEFAULT '0' COMMENT '1: able to import from excel, 0: not',
43 `can_export` tinyint(3) unsigned DEFAULT '0' COMMENT '1: able to export from excel, 0: not',
44 `can_export_detail` tinyint(4) DEFAULT NULL COMMENT '1: xu?t hóa ??n chi ti?t',
45 `can_custom_fee` tinyint(3) unsigned DEFAULT '0' COMMENT '1: able to custom the ship fee, 0: not',
46 `use_custom_fee` tinyint(3) unsigned DEFAULT '0' COMMENT '1: use the customized fee to calculate the ship fee, 0: not',
47 `use_warehouse` tinyint(4) DEFAULT '0' COMMENT '1: use wareshouse, 0: not',
48 `use_discount` tinyint(3) unsigned DEFAULT '1' COMMENT 'Can use common discounts',
49 `token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Token of client for accessing the api',
50 `station_id` int(10) unsigned DEFAULT NULL,
51 `service_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Token of client for accessing the service',
52 `area1` longtext COLLATE utf8_unicode_ci,
53 `fee_area1` int(11) DEFAULT '20000',
54 `area2` longtext COLLATE utf8_unicode_ci,
55 `fee_area2` int(11) DEFAULT '25000',
56 `area3` longtext COLLATE utf8_unicode_ci,
57 `fee_area3` int(11) DEFAULT '35000',
58 `fbk_email` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
59 `fbk_name` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
60 `fbk_link` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
61 `fbk_gender` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
62 `fbk_birthday` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
63 `fbk_location` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
64 `fbk_registered_at` datetime DEFAULT NULL,
65 `last_sent_email` datetime DEFAULT NULL,
66 `sent_summary_email_at` datetime DEFAULT NULL,
67 `last_sent_consultant_email` datetime DEFAULT NULL,
68 `come_from` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
69 `categories` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
70 `note` text COLLATE utf8_unicode_ci,
71 `auditing_note` text COLLATE utf8_unicode_ci,
72 `website` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
73 `consultant_id` int(11) DEFAULT NULL,
74 `manager_id` int(11) DEFAULT NULL,
75 `express_types` varchar(250) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
76 `session_id` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
77 `fee_pick` int(10) unsigned NOT NULL DEFAULT '0',
78 `fee_deliver` int(10) unsigned NOT NULL DEFAULT '0',
79 `created` datetime DEFAULT NULL,
80 `modified` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
81 `appoint_at` datetime DEFAULT NULL,
82 `last_loggedin` datetime DEFAULT NULL,
83 `registered_source` tinyint(3) unsigned DEFAULT NULL COMMENT '1: admin, 2: webform, 3: mobile form, 4: api',
84 `auditing_locked` tinyint(3) unsigned DEFAULT '0' COMMENT '0: is free, 1: is locked for auditing',
85 `owner_shop_id` char(36) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Owned by other shop',
86 `pick_cart_id` char(36) COLLATE utf8_unicode_ci DEFAULT NULL,
87 `sms_report_per_work_shift` tinyint(4) unsigned NOT NULL DEFAULT '0' COMMENT 'Receive sms report per work shift',
88 `prepayment` tinyint(1) DEFAULT '1',
89 `wallet_value` int(10) unsigned NOT NULL DEFAULT '0',
90 `auto_approved` tinyint(4) DEFAULT '0',
91 `is_new` tinyint(1) DEFAULT '0' COMMENT 'shop m?i, s? ??n hoàn thành ít h?n 10',
92 `cf_method_auto` tinyint(1) DEFAULT '0',
93 `cfw_extra` float DEFAULT '500',
94 `cf_extra1` int(11) DEFAULT '10000',
95 `cf_extra2` int(11) DEFAULT '10000',
96 `cf_extra3` int(11) DEFAULT '10000',
97 `cross_config` text CHARACTER SET ascii,
98 `first_completed` datetime DEFAULT NULL,
99 `first_completed_note` text COLLATE utf8_unicode_ci,
100 `rf_value` int(11) DEFAULT '5000' COMMENT 'Phí tr? hàng n?i vùng',
101 `rf_percent` float DEFAULT '0',
102 `rf_cross_value` int(11) DEFAULT '0' COMMENT 'Phí tr? hàng ngo?i vùng',
103 `rf_cross_percent` float DEFAULT '0.5',
104 `webhook` tinyint(1) DEFAULT '0' COMMENT '0: Không s? d?ng webhook, 1: Có s? d?ng webhook',
105 `cod_editable_pick_money` tinyint(1) DEFAULT '1' COMMENT '0: COD không có quy?n s?a phí ship; 1: COD có th? s?a phí ship',
106 `cod_able_delivered_apart` tinyint(1) DEFAULT '1' COMMENT '0: COD không có quy?n giao hàng 1 ph?n',
107 `cad` tinyint(1) DEFAULT '1',
108 `create_account` tinyint(1) DEFAULT NULL,
109 `otp` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Mã otp',
110 `ttl` int(11) DEFAULT NULL,
111 `potential` tinyint(4) DEFAULT '0',
112 `fee_manager_method` tinyint(1) DEFAULT '1',
113 `is_b2c` tinyint(1) DEFAULT '0',
114 `bc_station_id` int(11) DEFAULT '0',
115 `receive_sms_cod` int(1) NOT NULL DEFAULT '1',
116 `last_changed_pw` datetime DEFAULT NULL,
117 `is_fragile` tinyint(2) DEFAULT '0' COMMENT 'Shop co? ha?ng dê? v??',
118 PRIMARY KEY (`id`),
119 UNIQUE KEY `IDX_CODE` (`code`),
120 UNIQUE KEY `IDX_TOKEN` (`token`),
121 KEY `IDX_SHOP_STATUS_ID` (`shop_status_id`),
122 KEY `IDX_STATION_ID` (`station_id`),
123 KEY `order` (`order`),
124 KEY `IDX_TEL` (`tel`),
125 KEY `IDX_PROVINCE_ID` (`province_id`),
126 KEY `IDX_DISTRICT_ID` (`district_id`),
127 KEY `registered_source` (`registered_source`),
128 KEY `IDX_CREATED` (`created`)
129) ENGINE=InnoDB AUTO_INCREMENT=20332639 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
130