-
CREATE TABLE `tp_brand` (
-
`id` smallint(
5) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'品牌表',
-
`name` varchar(
60) NOT
NULL
DEFAULT
'' COMMENT
'品牌名称',
-
`logo` varchar(
80) NOT
NULL
DEFAULT
'' COMMENT
'品牌logo',
-
`desc` text NOT
NULL COMMENT
'品牌描述',
-
`url` varchar(
255) NOT
NULL
DEFAULT
'' COMMENT
'品牌地址',
-
`sort` tinyint(
3) unsigned NOT
NULL
DEFAULT
'50' COMMENT
'排序',
-
`cat_name` varchar(
128)
DEFAULT
'' COMMENT
'品牌分类',
-
`parent_cat_id` int(
11)
DEFAULT
'0' COMMENT
'分类id',
-
`cat_id` int(
10)
DEFAULT
'0' COMMENT
'分类id',
-
`is_hot` tinyint(
1)
DEFAULT
'0' COMMENT
'是否推荐',
-
PRIMARY KEY (`id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
351
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_goods` (
-
`goods_id` mediumint(
8) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'商品id',
-
`cat_id` int(
11) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'分类id',
-
`extend_cat_id` int(
11)
DEFAULT
'0' COMMENT
'扩展分类id',
-
`goods_sn` varchar(
60) NOT
NULL
DEFAULT
'' COMMENT
'商品编号',
-
`goods_name` varchar(
120) NOT
NULL
DEFAULT
'' COMMENT
'商品名称',
-
`click_count` int(
10) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'点击数',
-
`brand_id` smallint(
5) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'品牌id',
-
`store_count` smallint(
5) unsigned NOT
NULL
DEFAULT
'10' COMMENT
'库存数量',
-
`comment_count` smallint(
5)
DEFAULT
'0' COMMENT
'商品评论数',
-
`weight` int(
11) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'商品重量克为单位',
-
`market_price` decimal(
10,
2) unsigned NOT
NULL
DEFAULT
'0.00' COMMENT
'市场价',
-
`shop_price` decimal(
10,
2) unsigned NOT
NULL
DEFAULT
'0.00' COMMENT
'本店价',
-
`cost_price` decimal(
10,
2)
DEFAULT
'0.00' COMMENT
'商品成本价',
-
`price_ladder` text COMMENT
'价格阶梯',
-
`keywords` varchar(
255) NOT
NULL
DEFAULT
'' COMMENT
'商品关键词',
-
`goods_remark` varchar(
255) NOT
NULL
DEFAULT
'' COMMENT
'商品简单描述',
-
`goods_content` text COMMENT
'商品详细描述',
-
`original_img` varchar(
255) NOT
NULL
DEFAULT
'' COMMENT
'商品上传原始图',
-
`is_virtual` tinyint(
3) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'是否为虚拟商品 1是,0否',
-
`virtual_indate` int(
11)
DEFAULT
'0' COMMENT
'虚拟商品有效期',
-
`virtual_limit` smallint(
6)
DEFAULT
'0' COMMENT
'虚拟商品购买上限',
-
`virtual_refund` tinyint(
1)
DEFAULT
'1' COMMENT
'是否允许过期退款, 1是,0否',
-
`is_on_sale` tinyint(
1) unsigned NOT
NULL
DEFAULT
'1' COMMENT
'是否上架',
-
`is_free_shipping` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'是否包邮0否1是',
-
`on_time` int(
10) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'商品上架时间',
-
`sort` smallint(
4) unsigned NOT
NULL
DEFAULT
'50' COMMENT
'商品排序',
-
`is_recommend` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'是否推荐',
-
`is_new` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'是否新品',
-
`is_hot` tinyint(
1)
DEFAULT
'0' COMMENT
'是否热卖',
-
`last_update` int(
10) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'最后更新时间',
-
`goods_type` smallint(
5) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'商品所属类型id,取值表goods_type的cat_id',
-
`spec_type` smallint(
5)
DEFAULT
'0' COMMENT
'商品规格类型,取值表goods_type的cat_id',
-
`give_integral` mediumint(
8)
DEFAULT
'0' COMMENT
'购买商品赠送积分',
-
`exchange_integral` int(
10) NOT
NULL
DEFAULT
'0' COMMENT
'积分兑换:0不参与积分兑换,积分和现金的兑换比例见后台配置',
-
`suppliers_id` smallint(
5) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'供货商ID',
-
`sales_sum` int(
11)
DEFAULT
'0' COMMENT
'商品销量',
-
`prom_type` tinyint(
1)
DEFAULT
'0' COMMENT
'0默认1抢购2团购3优惠促销4预售5虚拟(5其实没用)6拼团',
-
`prom_id` int(
11)
DEFAULT
'0' COMMENT
'优惠活动id',
-
`commission` decimal(
10,
2)
DEFAULT
'0.00' COMMENT
'佣金用于分销分成',
-
`spu` varchar(
128)
DEFAULT
'' COMMENT
'SPU',
-
`sku` varchar(
128)
DEFAULT
'' COMMENT
'SKU',
-
`shipping_area_ids` varchar(
255) NOT
NULL
DEFAULT
'' COMMENT
'配送物流shipping_area_id,以逗号分隔',
-
PRIMARY KEY (`goods_id`),
-
KEY `goods_sn` (`goods_sn`),
-
KEY `cat_id` (`cat_id`),
-
KEY `last_update` (`last_update`),
-
KEY `brand_id` (`brand_id`),
-
KEY `goods_number` (`store_count`),
-
KEY `goods_weight` (`weight`),
-
KEY `sort_order` (`sort`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
144
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_spec_goods_price` (
-
`item_id` bigint(
20) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'规格商品id',
-
`goods_id` int(
11)
DEFAULT
'0' COMMENT
'商品id',
-
`key` varchar(
255) CHARACTER SET utf8 COLLATE utf8_bin
DEFAULT
NULL COMMENT
'规格键名',
-
`key_name` varchar(
255) CHARACTER SET utf8 COLLATE utf8_bin
DEFAULT
NULL COMMENT
'规格键名中文',
-
`price` decimal(
10,
2)
DEFAULT
NULL COMMENT
'价格',
-
`store_count` int(
11) unsigned
DEFAULT
'10' COMMENT
'库存数量',
-
`bar_code` varchar(
32) CHARACTER SET utf8 COLLATE utf8_bin
DEFAULT
'' COMMENT
'商品条形码',
-
`sku` varchar(
128) CHARACTER SET utf8 COLLATE utf8_bin
DEFAULT
'' COMMENT
'SKU',
-
`spec_img` varchar(
255)
DEFAULT
NULL COMMENT
'规格商品主图',
-
`prom_id` int(
10)
DEFAULT
'0' COMMENT
'活动id',
-
`prom_type` tinyint(
2)
DEFAULT
'0' COMMENT
'参加活动类型',
-
PRIMARY KEY (`item_id`),
-
KEY `key` (`key`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
230
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_cart` (
-
`id` int(
8) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'购物车表',
-
`user_id` mediumint(
8) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'用户id',
-
`session_id` char(
128) CHARACTER SET utf8 COLLATE utf8_bin NOT
NULL
DEFAULT
'' COMMENT
'session',
-
`goods_id` mediumint(
8) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'商品id',
-
`goods_sn` varchar(
60) NOT
NULL
DEFAULT
'' COMMENT
'商品货号',
-
`goods_name` varchar(
120) NOT
NULL
DEFAULT
'' COMMENT
'商品名称',
-
`market_price` decimal(
10,
2) unsigned NOT
NULL
DEFAULT
'0.00' COMMENT
'市场价',
-
`goods_price` decimal(
10,
2) NOT
NULL
DEFAULT
'0.00' COMMENT
'本店价',
-
`member_goods_price` decimal(
10,
2)
DEFAULT
'0.00' COMMENT
'会员折扣价',
-
`goods_num` smallint(
5) unsigned
DEFAULT
'0' COMMENT
'购买数量',
-
`spec_key` varchar(
64)
DEFAULT
'' COMMENT
'商品规格key 对应tp_spec_goods_price 表',
-
`spec_key_name` varchar(
64)
DEFAULT
'' COMMENT
'商品规格组合名称',
-
`bar_code` varchar(
64)
DEFAULT
'' COMMENT
'商品条码',
-
`selected` tinyint(
1)
DEFAULT
'1' COMMENT
'购物车选中状态',
-
`add_time` int(
11)
DEFAULT
'0' COMMENT
'加入购物车的时间',
-
`prom_type` tinyint(
1)
DEFAULT
'0' COMMENT
'0 普通订单,1 限时抢购, 2 团购 , 3 促销优惠',
-
`prom_id` int(
11)
DEFAULT
'0' COMMENT
'活动id',
-
`sku` varchar(
128)
DEFAULT
'' COMMENT
'sku',
-
PRIMARY KEY (`id`),
-
KEY `session_id` (`session_id`),
-
KEY `user_id` (`user_id`),
-
KEY `goods_id` (`goods_id`),
-
KEY `spec_key` (`spec_key`)
-
) ENGINE=InnoDB
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_coupon` (
-
`id` int(
8) NOT
NULL AUTO_INCREMENT COMMENT
'表id',
-
`name` varchar(
50) NOT
NULL
DEFAULT
'' COMMENT
'优惠券名字',
-
`type` tinyint(
1) NOT
NULL
DEFAULT
'0' COMMENT
'发放类型 0下单赠送1 指定发放 2 免费领取 3线下发放',
-
`money` decimal(
10,
2) NOT
NULL
DEFAULT
'0.00' COMMENT
'优惠券金额',
-
`condition` decimal(
10,
2) NOT
NULL
DEFAULT
'0.00' COMMENT
'使用条件',
-
`createnum` int(
11)
DEFAULT
'0' COMMENT
'发放数量',
-
`send_num` int(
11)
DEFAULT
'0' COMMENT
'已领取数量',
-
`use_num` int(
11)
DEFAULT
'0' COMMENT
'已使用数量',
-
`send_start_time` int(
11)
DEFAULT
NULL COMMENT
'发放开始时间',
-
`send_end_time` int(
11)
DEFAULT
NULL COMMENT
'发放结束时间',
-
`use_start_time` int(
11)
DEFAULT
NULL COMMENT
'使用开始时间',
-
`use_end_time` int(
11)
DEFAULT
NULL COMMENT
'使用结束时间',
-
`add_time` int(
11)
DEFAULT
NULL COMMENT
'添加时间',
-
`status` int(
2)
DEFAULT
NULL COMMENT
'状态:0无效,1有效',
-
`use_type` tinyint(
1)
DEFAULT
'0' COMMENT
'使用范围:0全店通用1指定商品可用2指定分类商品可用',
-
PRIMARY KEY (`id`),
-
KEY `use_end_time` (`use_end_time`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
21
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_coupon_list` (
-
`id` int(
8) NOT
NULL AUTO_INCREMENT COMMENT
'表id',
-
`cid` int(
8) NOT
NULL
DEFAULT
'0' COMMENT
'优惠券 对应coupon表id',
-
`type` tinyint(
1) NOT
NULL
DEFAULT
'0' COMMENT
'发放类型 1 按订单发放 2 注册 3 邀请 4 按用户发放',
-
`uid` int(
8) NOT
NULL
DEFAULT
'0' COMMENT
'用户id',
-
`order_id` int(
8) NOT
NULL
DEFAULT
'0' COMMENT
'订单id',
-
`get_order_id` int(
11)
DEFAULT
'0' COMMENT
'优惠券来自订单ID',
-
`use_time` int(
11) NOT
NULL
DEFAULT
'0' COMMENT
'使用时间',
-
`code` varchar(
10)
DEFAULT
'' COMMENT
'优惠券兑换码',
-
`send_time` int(
11) NOT
NULL
DEFAULT
'0' COMMENT
'发放时间',
-
`status` tinyint(
1)
DEFAULT
'0' COMMENT
'0未使用1已使用2已过期',
-
PRIMARY KEY (`id`),
-
KEY `cid` (`cid`),
-
KEY `uid` (`uid`),
-
KEY `code` (`code`),
-
KEY `order_id` (`order_id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
189
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_delivery_doc` (
-
`id` int(
11) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'发货单ID',
-
`order_id` int(
11) unsigned NOT
NULL COMMENT
'订单ID',
-
`order_sn` varchar(
64) NOT
NULL
DEFAULT
'' COMMENT
'订单编号',
-
`user_id` int(
11) unsigned NOT
NULL COMMENT
'用户ID',
-
`admin_id` int(
11) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'管理员ID',
-
`consignee` varchar(
64) NOT
NULL
DEFAULT
'' COMMENT
'收货人',
-
`zipcode` varchar(
6)
DEFAULT
NULL COMMENT
'邮编',
-
`mobile` varchar(
20) NOT
NULL
DEFAULT
'' COMMENT
'联系手机',
-
`country` int(
11) unsigned NOT
NULL COMMENT
'国ID',
-
`province` int(
11) unsigned NOT
NULL COMMENT
'省ID',
-
`city` int(
11) unsigned NOT
NULL COMMENT
'市ID',
-
`district` int(
11) unsigned NOT
NULL COMMENT
'区ID',
-
`address` varchar(
255) NOT
NULL
DEFAULT
'' COMMENT
'地址',
-
`shipping_code` varchar(
32)
DEFAULT
NULL COMMENT
'物流code',
-
`shipping_name` varchar(
64)
DEFAULT
NULL COMMENT
'快递名称',
-
`shipping_price` decimal(
10,
2)
DEFAULT
'0.00' COMMENT
'运费',
-
`invoice_no` varchar(
255) NOT
NULL
DEFAULT
'' COMMENT
'物流单号',
-
`tel` varchar(
64)
DEFAULT
NULL COMMENT
'座机电话',
-
`note` text COMMENT
'管理员添加的备注信息',
-
`best_time` int(
11)
DEFAULT
NULL COMMENT
'友好收货时间',
-
`create_time` int(
11) NOT
NULL COMMENT
'创建时间',
-
`is_del` tinyint(
1)
DEFAULT
'0' COMMENT
'是否删除',
-
PRIMARY KEY (`id`),
-
KEY `order_id` (`order_id`),
-
KEY `user_id` (`user_id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
46
DEFAULT CHARSET=utf8 COMMENT=
'发货单';
-
CREATE TABLE `tp_flash_sale` (
-
`id` bigint(
10) NOT
NULL AUTO_INCREMENT,
-
`title` varchar(
200) NOT
NULL
DEFAULT
'' COMMENT
'活动标题',
-
`goods_id` int(
10) NOT
NULL COMMENT
'参团商品ID',
-
`item_id` bigint(
20)
DEFAULT
'0' COMMENT
'对应spec_goods_price商品规格id',
-
`price` float(
10,
2) NOT
NULL COMMENT
'活动价格',
-
`goods_num` int(
10)
DEFAULT
'1' COMMENT
'商品参加活动数',
-
`buy_limit` int(
11) NOT
NULL
DEFAULT
'1' COMMENT
'每人限购数',
-
`buy_num` int(
11) NOT
NULL
DEFAULT
'0' COMMENT
'已购买人数',
-
`order_num` int(
10)
DEFAULT
'0' COMMENT
'已下单数',
-
`description` text COMMENT
'活动描述',
-
`start_time` int(
11) NOT
NULL COMMENT
'开始时间',
-
`end_time` int(
11) NOT
NULL COMMENT
'结束时间',
-
`is_end` tinyint(
1)
DEFAULT
'0' COMMENT
'是否已结束',
-
`goods_name` varchar(
255)
DEFAULT
NULL COMMENT
'商品名称',
-
PRIMARY KEY (`id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
13
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_goods_activity` (
-
`act_id` mediumint(
8) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'活动ID',
-
`act_name` varchar(
255) NOT
NULL
DEFAULT
'' COMMENT
'活动名称',
-
`act_desc` text NOT
NULL COMMENT
'活动描述',
-
`act_type` tinyint(
3) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'活动类型:1预售2拼团',
-
`goods_id` mediumint(
8) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'参加活动商品ID',
-
`spec_id` mediumint(
8) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'商品规格ID',
-
`goods_name` varchar(
255) NOT
NULL
DEFAULT
'' COMMENT
'商品名称',
-
`start_time` int(
10) unsigned NOT
NULL COMMENT
'活动开始时间',
-
`end_time` int(
10) unsigned NOT
NULL COMMENT
'活动结束时间',
-
`is_finished` tinyint(
3) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'是否已结束:0,正常;1,成功结束;2,失败结束。',
-
`ext_info` text NOT
NULL COMMENT
'活动扩展配置',
-
`act_count` mediumint(
8) NOT
NULL
DEFAULT
'0' COMMENT
'商品购买数',
-
PRIMARY KEY (`act_id`),
-
KEY `act_name` (`act_name`,`act_type`,`goods_id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
2
DEFAULT CHARSET=utf8;
用于商品详情页的属性展示,与商品价格无关,商品价格根据商品规格直接关联
-
CREATE TABLE `tp_goods_attr` (
-
`goods_attr_id` int(
10) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'商品属性id自增',
-
`goods_id` mediumint(
8) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'商品id',
-
`attr_id` smallint(
5) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'属性id',
-
`attr_value` text NOT
NULL COMMENT
'属性值',
-
`attr_price` varchar(
255) NOT
NULL
DEFAULT
'' COMMENT
'属性价格',
-
PRIMARY KEY (`goods_attr_id`),
-
KEY `goods_id` (`goods_id`),
-
KEY `attr_id` (`attr_id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
999
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_goods_attribute` (
-
`attr_id` int(
11) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'属性id',
-
`attr_name` varchar(
60) NOT
NULL
DEFAULT
'' COMMENT
'属性名称',
-
`type_id` smallint(
5) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'属性分类id',
-
`attr_index` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'0不需要检索 1关键字检索 2范围检索',
-
`attr_type` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'0唯一属性 1单选属性 2复选属性',
-
`attr_input_type` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
' 0 手工录入 1从列表中选择 2多行文本框',
-
`attr_values` text NOT
NULL COMMENT
'可选值列表',
-
`order` tinyint(
3) unsigned NOT
NULL
DEFAULT
'50' COMMENT
'属性排序',
-
PRIMARY KEY (`attr_id`),
-
KEY `cat_id` (`type_id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
329
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_goods_category` (
-
`id` smallint(
5) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'商品分类id',
-
`name` varchar(
90) NOT
NULL
DEFAULT
'' COMMENT
'商品分类名称',
-
`mobile_name` varchar(
64) CHARACTER SET utf8 COLLATE utf8_bin
DEFAULT
'' COMMENT
'手机端显示的商品分类名',
-
`parent_id` smallint(
5) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'父id',
-
`parent_id_path` varchar(
128) CHARACTER SET utf8 COLLATE utf8_bin
DEFAULT
'' COMMENT
'家族图谱',
-
`level` tinyint(
1)
DEFAULT
'0' COMMENT
'等级',
-
`sort_order` tinyint(
1) unsigned NOT
NULL
DEFAULT
'50' COMMENT
'顺序排序',
-
`is_show` tinyint(
1) unsigned NOT
NULL
DEFAULT
'1' COMMENT
'是否显示',
-
`image` varchar(
512) CHARACTER SET utf8 COLLATE utf8_bin
DEFAULT
'' COMMENT
'分类图片',
-
`is_hot` tinyint(
1)
DEFAULT
'0' COMMENT
'是否推荐为热门分类',
-
`cat_group` tinyint(
1)
DEFAULT
'0' COMMENT
'分类分组默认0',
-
`commission_rate` tinyint(
1)
DEFAULT
'0' COMMENT
'分佣比例',
-
PRIMARY KEY (`id`),
-
KEY `parent_id` (`parent_id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
844
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_goods_collect` (
-
`collect_id` mediumint(
8) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'表id',
-
`user_id` mediumint(
8) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'用户id',
-
`goods_id` mediumint(
8) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'商品id',
-
`add_time` int(
11) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'添加时间',
-
PRIMARY KEY (`collect_id`),
-
KEY `user_id` (`user_id`),
-
KEY `goods_id` (`goods_id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
247
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_goods_images` (
-
`img_id` mediumint(
8) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'图片id 自增',
-
`goods_id` mediumint(
8) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'商品id',
-
`image_url` varchar(
255) NOT
NULL
DEFAULT
'' COMMENT
'图片地址',
-
PRIMARY KEY (`img_id`),
-
KEY `goods_id` (`goods_id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
549
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_goods_type` (
-
`id` smallint(
5) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'id自增',
-
`name` varchar(
60) NOT
NULL
DEFAULT
'' COMMENT
'类型名称',
-
PRIMARY KEY (`id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
34
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_goods_visit` (
-
`visit_id` int(
11) NOT
NULL AUTO_INCREMENT COMMENT
'自增ID',
-
`goods_id` int(
11) NOT
NULL COMMENT
'商品ID',
-
`user_id` int(
11) NOT
NULL COMMENT
'会员ID',
-
`visittime` int(
11) NOT
NULL COMMENT
'浏览时间',
-
`cat_id` int(
11) NOT
NULL COMMENT
'商品分类ID',
-
`extend_cat_id` int(
11) NOT
NULL COMMENT
'商品扩展分类ID',
-
PRIMARY KEY (`goods_id`,`user_id`,`visit_id`),
-
KEY `visit_id` (`visit_id`),
-
KEY `user_id` (`user_id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
17
DEFAULT CHARSET=utf8 COMMENT=
'商品浏览历史表';
-
CREATE TABLE `tp_group_buy` (
-
`id` int(
10) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'团购ID',
-
`title` varchar(
255) NOT
NULL
DEFAULT
'' COMMENT
'活动名称',
-
`start_time` int(
10) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'开始时间',
-
`end_time` int(
10) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'结束时间',
-
`goods_id` int(
10) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'商品ID',
-
`item_id` bigint(
20)
DEFAULT
'0' COMMENT
'对应spec_goods_price商品规格id',
-
`price` decimal(
10,
2) NOT
NULL COMMENT
'团购价格',
-
`goods_num` int(
10)
DEFAULT
'0' COMMENT
'商品参团数',
-
`buy_num` int(
10) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'商品已购买数',
-
`order_num` int(
10) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'已下单人数',
-
`virtual_num` int(
10) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'虚拟购买数',
-
`rebate` decimal(
10,
1) NOT
NULL COMMENT
'折扣',
-
`intro` text COMMENT
'本团介绍',
-
`goods_price` decimal(
10,
2) NOT
NULL COMMENT
'商品原价',
-
`goods_name` varchar(
200) NOT
NULL
DEFAULT
'' COMMENT
'商品名称',
-
`recommended` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'是否推荐 0.未推荐 1.已推荐',
-
`views` int(
10) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'查看次数',
-
`is_end` tinyint(
1)
DEFAULT
'0' COMMENT
'是否结束',
-
PRIMARY KEY (`id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
9
DEFAULT CHARSET=utf8 COMMENT=
'团购商品表';
-
CREATE TABLE `tp_order` (
-
`order_id` mediumint(
8) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'订单id',
-
`order_sn` varchar(
20) NOT
NULL
DEFAULT
'' COMMENT
'订单编号',
-
`user_id` mediumint(
8) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'用户id',
-
`order_status` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'订单状态',
-
`shipping_status` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'发货状态',
-
`pay_status` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'支付状态',
-
`consignee` varchar(
60) NOT
NULL
DEFAULT
'' COMMENT
'收货人',
-
`country` int(
11) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'国家',
-
`province` int(
11) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'省份',
-
`city` int(
11) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'城市',
-
`district` int(
11) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'县区',
-
`twon` int(
11)
DEFAULT
'0' COMMENT
'乡镇',
-
`address` varchar(
255) NOT
NULL
DEFAULT
'' COMMENT
'地址',
-
`zipcode` varchar(
60) NOT
NULL
DEFAULT
'' COMMENT
'邮政编码',
-
`mobile` varchar(
60) NOT
NULL
DEFAULT
'' COMMENT
'手机',
-
`email` varchar(
60) NOT
NULL
DEFAULT
'' COMMENT
'邮件',
-
`shipping_code` varchar(
32) NOT
NULL
DEFAULT
'' COMMENT
'物流code',
-
`shipping_name` varchar(
120) NOT
NULL
DEFAULT
'' COMMENT
'物流名称',
-
`pay_code` varchar(
32) NOT
NULL
DEFAULT
'' COMMENT
'支付code',
-
`pay_name` varchar(
120) NOT
NULL
DEFAULT
'' COMMENT
'支付方式名称',
-
`invoice_title` varchar(
256)
DEFAULT
'' COMMENT
'发票抬头',
-
`goods_price` decimal(
10,
2) NOT
NULL
DEFAULT
'0.00' COMMENT
'商品总价',
-
`shipping_price` decimal(
10,
2) NOT
NULL
DEFAULT
'0.00' COMMENT
'邮费',
-
`user_money` decimal(
10,
2) NOT
NULL
DEFAULT
'0.00' COMMENT
'使用余额',
-
`coupon_price` decimal(
10,
2)
DEFAULT
'0.00' COMMENT
'优惠券抵扣',
-
`integral` int(
10) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'使用积分',
-
`integral_money` decimal(
10,
2) NOT
NULL
DEFAULT
'0.00' COMMENT
'使用积分抵多少钱',
-
`order_amount` decimal(
10,
2) NOT
NULL
DEFAULT
'0.00' COMMENT
'应付款金额',
-
`total_amount` decimal(
10,
2)
DEFAULT
'0.00' COMMENT
'订单总价',
-
`add_time` int(
10) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'下单时间',
-
`shipping_time` int(
11)
DEFAULT
'0' COMMENT
'最后新发货时间',
-
`confirm_time` int(
10)
DEFAULT
'0' COMMENT
'收货确认时间',
-
`pay_time` int(
10) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'支付时间',
-
`transaction_id` varchar(
255)
DEFAULT
NULL COMMENT
'第三方平台交易流水号',
-
`order_prom_type` tinyint(
4)
DEFAULT
'0' COMMENT
'0默认1抢购2团购3优惠4预售5虚拟6拼团',
-
`order_prom_id` smallint(
6) NOT
NULL
DEFAULT
'0' COMMENT
'活动id',
-
`order_prom_amount` decimal(
10,
2) NOT
NULL
DEFAULT
'0.00' COMMENT
'活动优惠金额',
-
`discount` decimal(
10,
2) NOT
NULL
DEFAULT
'0.00' COMMENT
'价格调整',
-
`user_note` varchar(
255) NOT
NULL
DEFAULT
'' COMMENT
'用户备注',
-
`admin_note` varchar(
255)
DEFAULT
'' COMMENT
'管理员备注',
-
`parent_sn` varchar(
100)
DEFAULT
NULL COMMENT
'父单单号',
-
`is_distribut` tinyint(
1)
DEFAULT
'0' COMMENT
'是否已分成0未分成1已分成',
-
`paid_money` decimal(
10,
2)
DEFAULT
'0.00' COMMENT
'订金',
-
`deleted` tinyint(
1) NOT
NULL
DEFAULT
'0' COMMENT
'用户假删除标识,1:删除,0未删除',
-
PRIMARY KEY (`order_id`),
-
UNIQUE KEY `order_sn` (`order_sn`),
-
KEY `user_id` (`user_id`),
-
KEY `add_time` (`add_time`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
1509
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_order_action` (
-
`action_id` mediumint(
8) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'表id',
-
`order_id` mediumint(
8) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'订单ID',
-
`action_user` int(
11)
DEFAULT
'0' COMMENT
'操作人 0 为用户操作,其他为管理员id',
-
`order_status` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'订单状态',
-
`shipping_status` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'配送状态',
-
`pay_status` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'支付状态',
-
`action_note` varchar(
255) NOT
NULL
DEFAULT
'' COMMENT
'操作备注',
-
`log_time` int(
11) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'操作时间',
-
`status_desc` varchar(
255)
DEFAULT
NULL COMMENT
'状态描述',
-
PRIMARY KEY (`action_id`),
-
KEY `order_id` (`order_id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
2195
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_order_goods` (
-
`rec_id` mediumint(
8) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'表id自增',
-
`order_id` mediumint(
8) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'订单id',
-
`goods_id` mediumint(
8) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'商品id',
-
`goods_name` varchar(
120) NOT
NULL
DEFAULT
'' COMMENT
'视频名称',
-
`goods_sn` varchar(
60) NOT
NULL
DEFAULT
'' COMMENT
'商品货号',
-
`goods_num` smallint(
5) unsigned NOT
NULL
DEFAULT
'1' COMMENT
'购买数量',
-
`market_price` decimal(
10,
2) NOT
NULL
DEFAULT
'0.00' COMMENT
'市场价',
-
`goods_price` decimal(
10,
2) NOT
NULL
DEFAULT
'0.00' COMMENT
'本店价',
-
`cost_price` decimal(
10,
2)
DEFAULT
'0.00' COMMENT
'商品成本价',
-
`member_goods_price` decimal(
10,
2)
DEFAULT
'0.00' COMMENT
'会员折扣价',
-
`give_integral` mediumint(
8)
DEFAULT
'0' COMMENT
'购买商品赠送积分',
-
`spec_key` varchar(
128)
DEFAULT
'' COMMENT
'商品规格key',
-
`spec_key_name` varchar(
128)
DEFAULT
'' COMMENT
'规格对应的中文名字',
-
`bar_code` varchar(
64) NOT
NULL
DEFAULT
'' COMMENT
'条码',
-
`is_comment` tinyint(
1)
DEFAULT
'0' COMMENT
'是否评价',
-
`prom_type` tinyint(
1)
DEFAULT
'0' COMMENT
'0 普通订单,1 限时抢购, 2 团购 , 3 促销优惠,4预售',
-
`prom_id` int(
11)
DEFAULT
'0' COMMENT
'活动id',
-
`is_send` tinyint(
1)
DEFAULT
'0' COMMENT
'0未发货,1已发货,2已换货,3已退货',
-
`delivery_id` int(
11)
DEFAULT
'0' COMMENT
'发货单ID',
-
`sku` varchar(
128)
DEFAULT
'' COMMENT
'sku',
-
PRIMARY KEY (`rec_id`),
-
KEY `order_id` (`order_id`),
-
KEY `goods_id` (`goods_id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
1773
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_payment` (
-
`pay_id` tinyint(
3) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'表id',
-
`pay_code` varchar(
20) NOT
NULL
DEFAULT
'' COMMENT
'支付code',
-
`pay_name` varchar(
120) NOT
NULL
DEFAULT
'' COMMENT
'支付方式名称',
-
`pay_fee` varchar(
10) NOT
NULL
DEFAULT
'' COMMENT
'手续费',
-
`pay_desc` text NOT
NULL COMMENT
'描述',
-
`pay_order` tinyint(
3) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'pay_coder',
-
`pay_config` text NOT
NULL COMMENT
'配置',
-
`enabled` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'开启',
-
`is_cod` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'是否货到付款',
-
`is_online` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'是否在线支付',
-
PRIMARY KEY (`pay_id`),
-
UNIQUE KEY `pay_code` (`pay_code`)
-
) ENGINE=InnoDB
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_return_goods` (
-
`id` int(
11) NOT
NULL AUTO_INCREMENT COMMENT
'退货申请表id自增',
-
`rec_id` int(
11)
DEFAULT
'0' COMMENT
'order_goods表id',
-
`order_id` int(
11)
DEFAULT
'0' COMMENT
'订单id',
-
`order_sn` varchar(
1024) CHARACTER SET utf8
DEFAULT
'' COMMENT
'订单编号',
-
`goods_id` int(
11)
DEFAULT
'0' COMMENT
'商品id',
-
`goods_num` int(
10)
DEFAULT
'1' COMMENT
'退货数量',
-
`type` tinyint(
1)
DEFAULT
'0' COMMENT
'0退货1换货',
-
`reason` varchar(
255) CHARACTER SET utf8
DEFAULT
'' COMMENT
'退换货原因',
-
`describe` varchar(
255) CHARACTER SET utf8
DEFAULT
'' COMMENT
'问题描述',
-
`imgs` varchar(
512) CHARACTER SET utf8
DEFAULT
'' COMMENT
'拍照图片路径',
-
`addtime` int(
11)
DEFAULT
'0' COMMENT
'申请时间',
-
`status` tinyint(
1)
DEFAULT
'0' COMMENT
'-2用户取消-1审核不通过0待审核1通过2已发货3已完成',
-
`remark` varchar(
1024) CHARACTER SET utf8
DEFAULT
'' COMMENT
'客服备注',
-
`user_id` int(
11)
DEFAULT
'0' COMMENT
'用户id',
-
`spec_key` varchar(
64) CHARACTER SET utf8
DEFAULT
'' COMMENT
'商品规格key 对应tp_spec_goods_price 表',
-
`seller_delivery` text CHARACTER SET utf8 COMMENT
'换货服务,卖家重新发货信息',
-
`refund_money` decimal(
10,
2)
DEFAULT
'0.00' COMMENT
'退还金额',
-
`refund_deposit` decimal(
10,
2)
DEFAULT
'0.00' COMMENT
'退还余额',
-
`refund_integral` int(
11)
DEFAULT
'0' COMMENT
'退还积分',
-
`refund_type` tinyint(
1)
DEFAULT
'0' COMMENT
'退款类型',
-
`refund_mark` varchar(
255) CHARACTER SET utf8
DEFAULT
NULL COMMENT
'退款备注',
-
`refund_time` int(
11)
DEFAULT
'0' COMMENT
'退款时间',
-
`is_receive` tinyint(
4)
DEFAULT
'0' COMMENT
'申请售后时是否收到货物',
-
PRIMARY KEY (`id`),
-
KEY `user_id` (`user_id`)
-
) ENGINE=InnoDB
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_spec` (
-
`id` int(
11) NOT
NULL AUTO_INCREMENT COMMENT
'规格表',
-
`type_id` int(
11)
DEFAULT
'0' COMMENT
'规格类型',
-
`name` varchar(
55)
DEFAULT
NULL COMMENT
'规格名称',
-
`order` int(
11)
DEFAULT
'50' COMMENT
'排序',
-
`search_index` tinyint(
1)
DEFAULT
'1' COMMENT
'是否需要检索:1是,0否',
-
PRIMARY KEY (`id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
27
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_spec_image` (
-
`goods_id` int(
11)
DEFAULT
'0' COMMENT
'商品规格图片表id',
-
`spec_image_id` int(
11)
DEFAULT
'0' COMMENT
'规格项id',
-
`src` varchar(
512) CHARACTER SET utf8 COLLATE utf8_bin
DEFAULT
'' COMMENT
'商品规格图片路径'
-
) ENGINE=InnoDB
DEFAULT CHARSET=latin1;
-
CREATE TABLE `tp_spec_item` (
-
`id` int(
11) NOT
NULL AUTO_INCREMENT COMMENT
'规格项id',
-
`spec_id` int(
11)
DEFAULT
NULL COMMENT
'规格id',
-
`item` varchar(
54)
DEFAULT
NULL COMMENT
'规格项',
-
PRIMARY KEY (`id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
114
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_stock_log` (
-
`id` int(
11) unsigned NOT
NULL AUTO_INCREMENT,
-
`goods_id` int(
11)
DEFAULT
NULL COMMENT
'商品ID',
-
`goods_name` varchar(
100)
DEFAULT
NULL COMMENT
'商品名称',
-
`goods_spec` varchar(
50)
DEFAULT
NULL COMMENT
'商品规格',
-
`order_sn` varchar(
30)
DEFAULT
NULL COMMENT
'订单编号',
-
`muid` int(
11)
DEFAULT
NULL COMMENT
'操作用户ID',
-
`stock` int(
11)
DEFAULT
NULL COMMENT
'更改库存',
-
`ctime` int(
11)
DEFAULT
NULL COMMENT
'操作时间',
-
PRIMARY KEY (`id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
331
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_user_address` (
-
`address_id` mediumint(
8) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'表id',
-
`user_id` mediumint(
8) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'用户id',
-
`consignee` varchar(
60) NOT
NULL
DEFAULT
'' COMMENT
'收货人',
-
`email` varchar(
60) NOT
NULL
DEFAULT
'' COMMENT
'邮箱地址',
-
`country` int(
11) NOT
NULL
DEFAULT
'0' COMMENT
'国家',
-
`province` int(
11) NOT
NULL
DEFAULT
'0' COMMENT
'省份',
-
`city` int(
11) NOT
NULL
DEFAULT
'0' COMMENT
'城市',
-
`district` int(
11) NOT
NULL
DEFAULT
'0' COMMENT
'地区',
-
`twon` int(
11)
DEFAULT
'0' COMMENT
'乡镇',
-
`address` varchar(
120) NOT
NULL
DEFAULT
'' COMMENT
'地址',
-
`zipcode` varchar(
60) NOT
NULL
DEFAULT
'' COMMENT
'邮政编码',
-
`mobile` varchar(
60) NOT
NULL
DEFAULT
'' COMMENT
'手机',
-
`is_default` tinyint(
1)
DEFAULT
'0' COMMENT
'默认收货地址',
-
`is_pickup` tinyint(
1)
DEFAULT
'0',
-
PRIMARY KEY (`address_id`),
-
KEY `user_id` (`user_id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
829
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_user_level` (
-
`level_id` smallint(
4) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'表id',
-
`level_name` varchar(
30)
DEFAULT
NULL COMMENT
'头衔名称',
-
`amount` decimal(
10,
2)
DEFAULT
NULL COMMENT
'等级必要金额',
-
`discount` smallint(
4)
DEFAULT
'0' COMMENT
'折扣',
-
`describe` varchar(
200)
DEFAULT
NULL COMMENT
'头街 描述',
-
PRIMARY KEY (`level_id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
7
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_users` (
-
`user_id` mediumint(
8) unsigned NOT
NULL AUTO_INCREMENT COMMENT
'表id',
-
`email` varchar(
60) NOT
NULL
DEFAULT
'' COMMENT
'邮件',
-
`password` varchar(
32) NOT
NULL
DEFAULT
'' COMMENT
'密码',
-
`paypwd` varchar(
32)
DEFAULT
NULL COMMENT
'支付密码',
-
`sex` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'0 保密 1 男 2 女',
-
`birthday` int(
11) NOT
NULL
DEFAULT
'0' COMMENT
'生日',
-
`user_money` decimal(
10,
2) NOT
NULL
DEFAULT
'0.00' COMMENT
'用户金额',
-
`frozen_money` decimal(
10,
2)
DEFAULT
'0.00' COMMENT
'冻结金额',
-
`distribut_money` decimal(
10,
2)
DEFAULT
'0.00' COMMENT
'累积分佣金额',
-
`underling_number` int(
5)
DEFAULT
'0' COMMENT
'用户下线总数',
-
`pay_points` int(
10) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'消费积分',
-
`address_id` mediumint(
8) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'默认收货地址',
-
`reg_time` int(
10) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'注册时间',
-
`last_login` int(
11) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'最后登录时间',
-
`last_ip` varchar(
15) NOT
NULL
DEFAULT
'' COMMENT
'最后登录ip',
-
`qq` varchar(
20) NOT
NULL
DEFAULT
'' COMMENT
'QQ',
-
`mobile` varchar(
20) NOT
NULL
DEFAULT
'' COMMENT
'手机号码',
-
`mobile_validated` tinyint(
3) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'是否验证手机',
-
`oauth` varchar(
10)
DEFAULT
'' COMMENT
'第三方来源 wx weibo alipay',
-
`openid` varchar(
100)
DEFAULT
NULL COMMENT
'第三方唯一标示',
-
`unionid` varchar(
100)
DEFAULT
NULL,
-
`head_pic` varchar(
255)
DEFAULT
NULL COMMENT
'头像',
-
`province` int(
6)
DEFAULT
'0' COMMENT
'省份',
-
`city` int(
6)
DEFAULT
'0' COMMENT
'市区',
-
`district` int(
6)
DEFAULT
'0' COMMENT
'县',
-
`email_validated` tinyint(
1) unsigned NOT
NULL
DEFAULT
'0' COMMENT
'是否验证电子邮箱',
-
`nickname` varchar(
50)
DEFAULT
NULL COMMENT
'第三方返回昵称',
-
`level` tinyint(
1)
DEFAULT
'1' COMMENT
'会员等级',
-
`discount` decimal(
10,
2)
DEFAULT
'1.00' COMMENT
'会员折扣,默认1不享受',
-
`total_amount` decimal(
10,
2)
DEFAULT
'0.00' COMMENT
'消费累计额度',
-
`is_lock` tinyint(
1)
DEFAULT
'0' COMMENT
'是否被锁定冻结',
-
`is_distribut` tinyint(
1)
DEFAULT
'0' COMMENT
'是否为分销商 0 否 1 是',
-
`first_leader` int(
11)
DEFAULT
'0' COMMENT
'第一个上级',
-
`second_leader` int(
11)
DEFAULT
'0' COMMENT
'第二个上级',
-
`third_leader` int(
11)
DEFAULT
'0' COMMENT
'第三个上级',
-
`token` varchar(
64)
DEFAULT
'' COMMENT
'用于app 授权类似于session_id',
-
`message_mask` tinyint(
1) NOT
NULL
DEFAULT
'63' COMMENT
'消息掩码',
-
`push_id` varchar(
30) NOT
NULL
DEFAULT
'' COMMENT
'推送id',
-
`distribut_level` tinyint(
2)
DEFAULT
'0' COMMENT
'分销商等级',
-
PRIMARY KEY (`user_id`),
-
KEY `email` (`email`),
-
KEY `underling_number` (`underling_number`),
-
KEY `mobile` (`mobile_validated`),
-
KEY `openid` (`openid`),
-
KEY `unionid` (`unionid`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
2594
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_recharge` (
-
`order_id` bigint(
20) NOT
NULL AUTO_INCREMENT,
-
`user_id` bigint(
20) NOT
NULL
DEFAULT
'0' COMMENT
'会员ID',
-
`nickname` varchar(
50)
DEFAULT
NULL COMMENT
'会员昵称',
-
`order_sn` varchar(
30) NOT
NULL
DEFAULT
'' COMMENT
'充值单号',
-
`account` float(
10,
2)
DEFAULT
'0.00' COMMENT
'充值金额',
-
`ctime` int(
11)
DEFAULT
NULL COMMENT
'充值时间',
-
`pay_time` int(
11)
DEFAULT
NULL COMMENT
'支付时间',
-
`pay_code` varchar(
20)
DEFAULT
NULL,
-
`pay_name` varchar(
80)
DEFAULT
NULL COMMENT
'支付方式',
-
`pay_status` tinyint(
1)
DEFAULT
'0' COMMENT
'充值状态0:待支付 1:充值成功 2:交易关闭',
-
PRIMARY KEY (`order_id`)
-
) ENGINE=InnoDB AUTO_INCREMENT=
127
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_user_extend` (
-
`id` int(
11) unsigned NOT
NULL AUTO_INCREMENT,
-
`user_id` int(
11) unsigned
DEFAULT
'0',
-
`invoice_title` varchar(
200) CHARACTER SET utf8
DEFAULT
NULL COMMENT
'发票抬头',
-
`taxpayer` varchar(
100) CHARACTER SET utf8
DEFAULT
NULL COMMENT
'纳税人识别号',
-
`invoice_desc` varchar(
50) CHARACTER SET utf8
DEFAULT
NULL COMMENT
'不开发票/明细',
-
`realname` varchar(
100) CHARACTER SET utf8
DEFAULT
NULL COMMENT
'真实姓名',
-
`idcard` varchar(
100) CHARACTER SET utf8
DEFAULT
NULL COMMENT
'身份证号',
-
PRIMARY KEY (`id`)
-
) ENGINE=InnoDB
DEFAULT CHARSET=utf8;
-
CREATE TABLE `tp_withdrawals` (
-
`id` int(
11) NOT
NULL AUTO_INCREMENT COMMENT
'提现申请表',
-
`user_id` int(
11)
DEFAULT
'0' COMMENT
'用户id',
-
`money` decimal(
10,
2)
DEFAULT
'0.00' COMMENT
'提现金额',
-
`create_time` int(
11)
DEFAULT
'0' COMMENT
'申请时间',
-
`check_time` int(
11)
DEFAULT
'0' COMMENT
'审核时间',
-
`pay_time` int(
11)
DEFAULT
'0' COMMENT
'支付时间',
-
`refuse_time` int(
11)
DEFAULT
'0' COMMENT
'拒绝时间',
-
`bank_name` varchar(
255) CHARACTER SET utf8 COLLATE utf8_bin
DEFAULT
'' COMMENT
'银行名称 如支付宝 微信 中国银行 农业银行等',
-
`bank_card` varchar(
255) CHARACTER SET utf8 COLLATE utf8_bin
DEFAULT
'' COMMENT
'银行账号或支付宝账号',
-
`realname` varchar(
100) CHARACTER SET utf8 COLLATE utf8_bin
DEFAULT
'' COMMENT
'提款账号真实姓名',
-
`remark` varchar(
255) CHARACTER SET utf8 COLLATE utf8_bin
DEFAULT
'' COMMENT
'提现备注',
-
`taxfee` decimal(
10,
2)
DEFAULT
'0.00' COMMENT
'税收手续费',
-
`status` tinyint(
1)
DEFAULT
'0' COMMENT
'状态:-2删除作废-1审核失败0申请中1审核通过2付款成功3付款失败',
-
`pay_code` varchar(
100)
DEFAULT
NULL COMMENT
'付款对账流水号',
-
`error_code` varchar(
255)
DEFAULT
NULL COMMENT
'付款失败错误代码',
-
PRIMARY KEY (`id`)
-
) ENGINE=InnoDB
DEFAULT CHARSET=utf8;