-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patho2o.sql
261 lines (217 loc) · 11 KB
/
o2o.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
/*
SQLyog Ultimate v12.08 (64 bit)
MySQL - 5.5.53 : Database - tp5_o2o
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`tp5_o2o` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `tp5_o2o`;
/*Table structure for table `o2o_area` */
DROP TABLE IF EXISTS `o2o_area`;
CREATE TABLE `o2o_area` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL DEFAULT '',
`city_id` int(11) unsigned NOT NULL DEFAULT '0',
`parent_id` int(10) unsigned NOT NULL DEFAULT '0',
`listorder` int(8) unsigned NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL DEFAULT '0',
`create_time` int(11) unsigned NOT NULL DEFAULT '0',
`update_time` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `parent_id` (`parent_id`),
KEY `city_id` (`city_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Data for the table `o2o_area` */
/*Table structure for table `o2o_bis` */
DROP TABLE IF EXISTS `o2o_bis`;
CREATE TABLE `o2o_bis` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL DEFAULT '',
`email` varchar(50) NOT NULL DEFAULT '',
`logo` varchar(255) NOT NULL DEFAULT '',
`licence_logo` varchar(255) NOT NULL DEFAULT '' COMMENT '营业执照',
`description` text NOT NULL,
`city_id` int(11) unsigned NOT NULL DEFAULT '0',
`city_path` varchar(50) NOT NULL DEFAULT '',
`bank_info` varchar(50) NOT NULL DEFAULT '',
`money` decimal(20,2) NOT NULL DEFAULT '0.00',
`bank_name` varchar(50) NOT NULL DEFAULT '' COMMENT '开户行名称',
`bank_user` varchar(50) NOT NULL DEFAULT '' COMMENT '开户人',
`faren` varchar(20) NOT NULL DEFAULT '' COMMENT '法人',
`faren_tel` varchar(20) NOT NULL DEFAULT '' COMMENT '法人联系方式',
`listorder` int(8) unsigned NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL DEFAULT '0',
`create_time` int(11) unsigned NOT NULL DEFAULT '0',
`update_time` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `NAME` (`name`),
KEY `city_id` (`city_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Data for the table `o2o_bis` */
/*Table structure for table `o2o_bis_account` */
DROP TABLE IF EXISTS `o2o_bis_account`;
CREATE TABLE `o2o_bis_account` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL DEFAULT '',
`password` char(32) NOT NULL DEFAULT '',
`code` varchar(10) NOT NULL DEFAULT '',
`bis_id` int(11) unsigned NOT NULL DEFAULT '0',
`last_login_ip` varchar(20) NOT NULL DEFAULT '',
`last_login_time` int(11) unsigned NOT NULL DEFAULT '0',
`is_main` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否是总点',
`listorder` int(8) unsigned NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL DEFAULT '0',
`create_time` int(11) unsigned NOT NULL DEFAULT '0',
`update_time` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `username` (`username`),
KEY `bis_id` (`bis_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Data for the table `o2o_bis_account` */
/*Table structure for table `o2o_bis_location` */
DROP TABLE IF EXISTS `o2o_bis_location`;
CREATE TABLE `o2o_bis_location` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL DEFAULT '',
`logo` varchar(255) NOT NULL DEFAULT '',
`address` varchar(255) NOT NULL DEFAULT '',
`tel` varchar(20) NOT NULL DEFAULT '',
`contact` varchar(20) NOT NULL DEFAULT '',
`xpoint` varchar(20) NOT NULL DEFAULT '' COMMENT '经度',
`ypoint` varchar(20) NOT NULL DEFAULT '' COMMENT '维度',
`bis_id` int(11) unsigned NOT NULL DEFAULT '0',
`open_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '营业时间',
`content` text NOT NULL COMMENT '门店介绍',
`is_main` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否是总店',
`api_address` varchar(255) NOT NULL DEFAULT '',
`city_id` int(11) unsigned NOT NULL DEFAULT '0',
`city_path` varchar(50) NOT NULL DEFAULT '',
`category_id` int(11) unsigned NOT NULL DEFAULT '0',
`category_path` varchar(50) NOT NULL DEFAULT '',
`bank_info` varchar(50) NOT NULL DEFAULT '',
`listorder` int(8) unsigned NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL DEFAULT '0',
`create_time` int(11) unsigned NOT NULL DEFAULT '0',
`update_time` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `NAME` (`name`),
KEY `city_id` (`city_id`),
KEY `bis_id` (`bis_id`),
KEY `category_id` (`category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Data for the table `o2o_bis_location` */
/*Table structure for table `o2o_category` */
DROP TABLE IF EXISTS `o2o_category`;
CREATE TABLE `o2o_category` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL DEFAULT '',
`parent_id` int(10) unsigned NOT NULL DEFAULT '0',
`listorder` int(8) unsigned NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL DEFAULT '0',
`create_time` int(11) unsigned NOT NULL DEFAULT '0',
`update_time` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `parent_id` (`parent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
/*Data for the table `o2o_category` */
insert into `o2o_category`(`id`,`name`,`parent_id`,`listorder`,`status`,`create_time`,`update_time`) values (1,'美食',0,1,1,1494554461,1497502058),(2,'娱乐',0,2,0,1494554471,1497493648),(3,'酒店',0,3,1,1494554832,1497491979),(4,'休闲',0,4,1,1494554840,1497495332),(5,'丽人',0,5,1,1494554846,1497496072),(6,'KTV',2,0,1,1494555059,1494555059),(7,'电影',0,6,0,1495441804,1497496081);
/*Table structure for table `o2o_city` */
DROP TABLE IF EXISTS `o2o_city`;
CREATE TABLE `o2o_city` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL DEFAULT '',
`uname` varchar(50) NOT NULL DEFAULT '',
`parent_id` int(10) unsigned NOT NULL DEFAULT '0',
`is_default` int(3) unsigned NOT NULL DEFAULT '0',
`listorder` int(8) unsigned NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL DEFAULT '0',
`create_time` int(11) unsigned NOT NULL DEFAULT '0',
`update_time` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `uname` (`uname`),
KEY `parent_id` (`parent_id`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
/*Data for the table `o2o_city` */
insert into `o2o_city`(`id`,`name`,`uname`,`parent_id`,`is_default`,`listorder`,`status`,`create_time`,`update_time`) values (1,'北京','beijing1',0,0,0,1,1474013959,0),(2,'北京','beijing',1,0,0,1,1474014007,0),(4,'江西','jiangxi',0,0,0,1,1474014162,0),(5,'南昌','nanchang',4,1,0,1,1474014181,0),(6,'上饶','shangrao',4,0,0,1,1474014193,0),(7,'抚州','fuzhou',4,0,0,1,1474014204,0),(8,'景德镇','jdz',4,0,0,1,1474014220,0),(9,'九江','jiujiang',4,0,0,1,0,0),(10,'赣州','ganzhou',4,0,0,1,0,0),(11,'萍乡','pingxiang',4,0,0,1,0,0),(12,'宜春','yichun',4,0,0,1,0,0),(13,'吉安','jian',4,0,0,1,0,0);
/*Table structure for table `o2o_deal` */
DROP TABLE IF EXISTS `o2o_deal`;
CREATE TABLE `o2o_deal` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL DEFAULT '',
`category_id` int(11) unsigned NOT NULL DEFAULT '0',
`se_category_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '二级栏目',
`bis_id` int(11) unsigned NOT NULL DEFAULT '0',
`location_ids` varchar(100) NOT NULL DEFAULT '' COMMENT '所属店面',
`image` varchar(200) NOT NULL DEFAULT '',
`description` text NOT NULL,
`start_time` int(11) unsigned NOT NULL DEFAULT '0',
`end_time` int(11) unsigned NOT NULL DEFAULT '0',
`origin_price` decimal(20,2) NOT NULL DEFAULT '0.00' COMMENT '原价',
`current_price` decimal(20,2) NOT NULL DEFAULT '0.00' COMMENT '当前价',
`city_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品所属城市',
`buy_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品购买了多少份',
`total_count` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品总数',
`coupons_begin_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '团购券开始时间',
`coupons_end_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '团购券结束时间',
`xpoint` varchar(20) NOT NULL DEFAULT '' COMMENT '经度',
`ypoint` varchar(20) NOT NULL DEFAULT '' COMMENT '维度',
`bis_account_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商家id',
`balance_price` decimal(20,2) NOT NULL DEFAULT '0.00' COMMENT '结算价',
`notice` text NOT NULL COMMENT '商品提示',
`listorder` int(8) unsigned NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL DEFAULT '0',
`create_time` int(11) unsigned NOT NULL DEFAULT '0',
`update_time` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `category_id` (`category_id`),
KEY `se_category_id` (`se_category_id`),
KEY `city_id` (`city_id`),
KEY `start_time` (`start_time`),
KEY `end_time` (`end_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Data for the table `o2o_deal` */
/*Table structure for table `o2o_featured` */
DROP TABLE IF EXISTS `o2o_featured`;
CREATE TABLE `o2o_featured` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` tinyint(1) unsigned NOT NULL DEFAULT '0',
`title` varchar(30) NOT NULL DEFAULT '',
`image` varchar(255) NOT NULL DEFAULT '',
`url` varchar(255) NOT NULL DEFAULT '',
`description` varchar(255) NOT NULL DEFAULT '',
`listorder` int(8) unsigned NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL DEFAULT '0',
`create_time` int(11) unsigned NOT NULL DEFAULT '0',
`update_time` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Data for the table `o2o_featured` */
/*Table structure for table `o2o_user` */
DROP TABLE IF EXISTS `o2o_user`;
CREATE TABLE `o2o_user` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(20) NOT NULL DEFAULT '',
`password` char(32) NOT NULL DEFAULT '',
`code` varchar(10) NOT NULL DEFAULT '',
`last_login_ip` varchar(20) NOT NULL DEFAULT '',
`last_login_time` int(11) unsigned NOT NULL DEFAULT '0',
`email` varchar(30) NOT NULL DEFAULT '',
`mobile` varchar(20) NOT NULL DEFAULT '',
`listorder` int(8) unsigned NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL DEFAULT '0',
`create_time` int(11) unsigned NOT NULL DEFAULT '0',
`update_time` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Data for the table `o2o_user` */
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;