PHP 电子商城基本数据表

1、品牌表 tp_brand

 
  1. CREATE TABLE `tp_brand` (

  2. `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT '品牌表',

  3. `name` varchar(60) NOT NULL DEFAULT '' COMMENT '品牌名称',

  4. `logo` varchar(80) NOT NULL DEFAULT '' COMMENT '品牌logo',

  5. `desc` text NOT NULL COMMENT '品牌描述',

  6. `url` varchar(255) NOT NULL DEFAULT '' COMMENT '品牌地址',

  7. `sort` tinyint(3) unsigned NOT NULL DEFAULT '50' COMMENT '排序',

  8. `cat_name` varchar(128) DEFAULT '' COMMENT '品牌分类',

  9. `parent_cat_id` int(11) DEFAULT '0' COMMENT '分类id',

  10. `cat_id` int(10) DEFAULT '0' COMMENT '分类id',

  11. `is_hot` tinyint(1) DEFAULT '0' COMMENT '是否推荐',

  12. PRIMARY KEY (`id`)

  13. ) ENGINE=InnoDB AUTO_INCREMENT=351 DEFAULT CHARSET=utf8;

  • 1

 

 

 

2、商品表 tp_goods

 
  1. CREATE TABLE `tp_goods` (

  2. `goods_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '商品id',

  3. `cat_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '分类id',

  4. `extend_cat_id` int(11) DEFAULT '0' COMMENT '扩展分类id',

  5. `goods_sn` varchar(60) NOT NULL DEFAULT '' COMMENT '商品编号',

  6. `goods_name` varchar(120) NOT NULL DEFAULT '' COMMENT '商品名称',

  7. `click_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '点击数',

  8. `brand_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '品牌id',

  9. `store_count` smallint(5) unsigned NOT NULL DEFAULT '10' COMMENT '库存数量',

  10. `comment_count` smallint(5) DEFAULT '0' COMMENT '商品评论数',

  11. `weight` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品重量克为单位',

  12. `market_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '市场价',

  13. `shop_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '本店价',

  14. `cost_price` decimal(10,2) DEFAULT '0.00' COMMENT '商品成本价',

  15. `price_ladder` text COMMENT '价格阶梯',

  16. `keywords` varchar(255) NOT NULL DEFAULT '' COMMENT '商品关键词',

  17. `goods_remark` varchar(255) NOT NULL DEFAULT '' COMMENT '商品简单描述',

  18. `goods_content` text COMMENT '商品详细描述',

  19. `original_img` varchar(255) NOT NULL DEFAULT '' COMMENT '商品上传原始图',

  20. `is_virtual` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否为虚拟商品 1是,0否',

  21. `virtual_indate` int(11) DEFAULT '0' COMMENT '虚拟商品有效期',

  22. `virtual_limit` smallint(6) DEFAULT '0' COMMENT '虚拟商品购买上限',

  23. `virtual_refund` tinyint(1) DEFAULT '1' COMMENT '是否允许过期退款, 1是,0否',

  24. `is_on_sale` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否上架',

  25. `is_free_shipping` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否包邮0否1是',

  26. `on_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商品上架时间',

  27. `sort` smallint(4) unsigned NOT NULL DEFAULT '50' COMMENT '商品排序',

  28. `is_recommend` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否推荐',

  29. `is_new` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否新品',

  30. `is_hot` tinyint(1) DEFAULT '0' COMMENT '是否热卖',

  31. `last_update` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '最后更新时间',

  32. `goods_type` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '商品所属类型id,取值表goods_type的cat_id',

  33. `spec_type` smallint(5) DEFAULT '0' COMMENT '商品规格类型,取值表goods_type的cat_id',

  34. `give_integral` mediumint(8) DEFAULT '0' COMMENT '购买商品赠送积分',

  35. `exchange_integral` int(10) NOT NULL DEFAULT '0' COMMENT '积分兑换:0不参与积分兑换,积分和现金的兑换比例见后台配置',

  36. `suppliers_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '供货商ID',

  37. `sales_sum` int(11) DEFAULT '0' COMMENT '商品销量',

  38. `prom_type` tinyint(1) DEFAULT '0' COMMENT '0默认1抢购2团购3优惠促销4预售5虚拟(5其实没用)6拼团',

  39. `prom_id` int(11) DEFAULT '0' COMMENT '优惠活动id',

  40. `commission` decimal(10,2) DEFAULT '0.00' COMMENT '佣金用于分销分成',

  41. `spu` varchar(128) DEFAULT '' COMMENT 'SPU',

  42. `sku` varchar(128) DEFAULT '' COMMENT 'SKU',

  43. `shipping_area_ids` varchar(255) NOT NULL DEFAULT '' COMMENT '配送物流shipping_area_id,以逗号分隔',

  44. PRIMARY KEY (`goods_id`),

  45. KEY `goods_sn` (`goods_sn`),

  46. KEY `cat_id` (`cat_id`),

  47. KEY `last_update` (`last_update`),

  48. KEY `brand_id` (`brand_id`),

  49. KEY `goods_number` (`store_count`),

  50. KEY `goods_weight` (`weight`),

  51. KEY `sort_order` (`sort`)

  52. ) ENGINE=InnoDB AUTO_INCREMENT=144 DEFAULT CHARSET=utf8;

  • 1

 

 

 

 

 

3、商品规格价格库存表 tp_spec_goods_price

 
  1. CREATE TABLE `tp_spec_goods_price` (

  2. `item_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '规格商品id',

  3. `goods_id` int(11) DEFAULT '0' COMMENT '商品id',

  4. `key` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '规格键名',

  5. `key_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '规格键名中文',

  6. `price` decimal(10,2) DEFAULT NULL COMMENT '价格',

  7. `store_count` int(11) unsigned DEFAULT '10' COMMENT '库存数量',

  8. `bar_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT '商品条形码',

  9. `sku` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT 'SKU',

  10. `spec_img` varchar(255) DEFAULT NULL COMMENT '规格商品主图',

  11. `prom_id` int(10) DEFAULT '0' COMMENT '活动id',

  12. `prom_type` tinyint(2) DEFAULT '0' COMMENT '参加活动类型',

  13. PRIMARY KEY (`item_id`),

  14. KEY `key` (`key`)

  15. ) ENGINE=InnoDB AUTO_INCREMENT=230 DEFAULT CHARSET=utf8;

  • 1


 

 

 

4、购物车表 tp_cart

 
  1. CREATE TABLE `tp_cart` (

  2. `id` int(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '购物车表',

  3. `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',

  4. `session_id` char(128) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT 'session',

  5. `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',

  6. `goods_sn` varchar(60) NOT NULL DEFAULT '' COMMENT '商品货号',

  7. `goods_name` varchar(120) NOT NULL DEFAULT '' COMMENT '商品名称',

  8. `market_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '市场价',

  9. `goods_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '本店价',

  10. `member_goods_price` decimal(10,2) DEFAULT '0.00' COMMENT '会员折扣价',

  11. `goods_num` smallint(5) unsigned DEFAULT '0' COMMENT '购买数量',

  12. `spec_key` varchar(64) DEFAULT '' COMMENT '商品规格key 对应tp_spec_goods_price 表',

  13. `spec_key_name` varchar(64) DEFAULT '' COMMENT '商品规格组合名称',

  14. `bar_code` varchar(64) DEFAULT '' COMMENT '商品条码',

  15. `selected` tinyint(1) DEFAULT '1' COMMENT '购物车选中状态',

  16. `add_time` int(11) DEFAULT '0' COMMENT '加入购物车的时间',

  17. `prom_type` tinyint(1) DEFAULT '0' COMMENT '0 普通订单,1 限时抢购, 2 团购 , 3 促销优惠',

  18. `prom_id` int(11) DEFAULT '0' COMMENT '活动id',

  19. `sku` varchar(128) DEFAULT '' COMMENT 'sku',

  20. PRIMARY KEY (`id`),

  21. KEY `session_id` (`session_id`),

  22. KEY `user_id` (`user_id`),

  23. KEY `goods_id` (`goods_id`),

  24. KEY `spec_key` (`spec_key`)

  25. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

  • 1

 

 

5、优惠券类型表 tp_coupon

 
  1. CREATE TABLE `tp_coupon` (

  2. `id` int(8) NOT NULL AUTO_INCREMENT COMMENT '表id',

  3. `name` varchar(50) NOT NULL DEFAULT '' COMMENT '优惠券名字',

  4. `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '发放类型 0下单赠送1 指定发放 2 免费领取 3线下发放',

  5. `money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '优惠券金额',

  6. `condition` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '使用条件',

  7. `createnum` int(11) DEFAULT '0' COMMENT '发放数量',

  8. `send_num` int(11) DEFAULT '0' COMMENT '已领取数量',

  9. `use_num` int(11) DEFAULT '0' COMMENT '已使用数量',

  10. `send_start_time` int(11) DEFAULT NULL COMMENT '发放开始时间',

  11. `send_end_time` int(11) DEFAULT NULL COMMENT '发放结束时间',

  12. `use_start_time` int(11) DEFAULT NULL COMMENT '使用开始时间',

  13. `use_end_time` int(11) DEFAULT NULL COMMENT '使用结束时间',

  14. `add_time` int(11) DEFAULT NULL COMMENT '添加时间',

  15. `status` int(2) DEFAULT NULL COMMENT '状态:0无效,1有效',

  16. `use_type` tinyint(1) DEFAULT '0' COMMENT '使用范围:0全店通用1指定商品可用2指定分类商品可用',

  17. PRIMARY KEY (`id`),

  18. KEY `use_end_time` (`use_end_time`)

  19. ) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;

  • 1

 

 

6、优惠券表 tp_coupon_list

 
  1. CREATE TABLE `tp_coupon_list` (

  2. `id` int(8) NOT NULL AUTO_INCREMENT COMMENT '表id',

  3. `cid` int(8) NOT NULL DEFAULT '0' COMMENT '优惠券 对应coupon表id',

  4. `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '发放类型 1 按订单发放 2 注册 3 邀请 4 按用户发放',

  5. `uid` int(8) NOT NULL DEFAULT '0' COMMENT '用户id',

  6. `order_id` int(8) NOT NULL DEFAULT '0' COMMENT '订单id',

  7. `get_order_id` int(11) DEFAULT '0' COMMENT '优惠券来自订单ID',

  8. `use_time` int(11) NOT NULL DEFAULT '0' COMMENT '使用时间',

  9. `code` varchar(10) DEFAULT '' COMMENT '优惠券兑换码',

  10. `send_time` int(11) NOT NULL DEFAULT '0' COMMENT '发放时间',

  11. `status` tinyint(1) DEFAULT '0' COMMENT '0未使用1已使用2已过期',

  12. PRIMARY KEY (`id`),

  13. KEY `cid` (`cid`),

  14. KEY `uid` (`uid`),

  15. KEY `code` (`code`),

  16. KEY `order_id` (`order_id`)

  17. ) ENGINE=InnoDB AUTO_INCREMENT=189 DEFAULT CHARSET=utf8;

  • 1

 

 

 

 

7、发货单 tp_delivery_doc

 
  1. CREATE TABLE `tp_delivery_doc` (

  2. `id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '发货单ID',

  3. `order_id` int(11) unsigned NOT NULL COMMENT '订单ID',

  4. `order_sn` varchar(64) NOT NULL DEFAULT '' COMMENT '订单编号',

  5. `user_id` int(11) unsigned NOT NULL COMMENT '用户ID',

  6. `admin_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '管理员ID',

  7. `consignee` varchar(64) NOT NULL DEFAULT '' COMMENT '收货人',

  8. `zipcode` varchar(6) DEFAULT NULL COMMENT '邮编',

  9. `mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '联系手机',

  10. `country` int(11) unsigned NOT NULL COMMENT '国ID',

  11. `province` int(11) unsigned NOT NULL COMMENT '省ID',

  12. `city` int(11) unsigned NOT NULL COMMENT '市ID',

  13. `district` int(11) unsigned NOT NULL COMMENT '区ID',

  14. `address` varchar(255) NOT NULL DEFAULT '' COMMENT '地址',

  15. `shipping_code` varchar(32) DEFAULT NULL COMMENT '物流code',

  16. `shipping_name` varchar(64) DEFAULT NULL COMMENT '快递名称',

  17. `shipping_price` decimal(10,2) DEFAULT '0.00' COMMENT '运费',

  18. `invoice_no` varchar(255) NOT NULL DEFAULT '' COMMENT '物流单号',

  19. `tel` varchar(64) DEFAULT NULL COMMENT '座机电话',

  20. `note` text COMMENT '管理员添加的备注信息',

  21. `best_time` int(11) DEFAULT NULL COMMENT '友好收货时间',

  22. `create_time` int(11) NOT NULL COMMENT '创建时间',

  23. `is_del` tinyint(1) DEFAULT '0' COMMENT '是否删除',

  24. PRIMARY KEY (`id`),

  25. KEY `order_id` (`order_id`),

  26. KEY `user_id` (`user_id`)

  27. ) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=utf8 COMMENT='发货单';

  • 1

 

 

 

8、限时抢购表 tp_flash_sale

 
  1. CREATE TABLE `tp_flash_sale` (

  2. `id` bigint(10) NOT NULL AUTO_INCREMENT,

  3. `title` varchar(200) NOT NULL DEFAULT '' COMMENT '活动标题',

  4. `goods_id` int(10) NOT NULL COMMENT '参团商品ID',

  5. `item_id` bigint(20) DEFAULT '0' COMMENT '对应spec_goods_price商品规格id',

  6. `price` float(10,2) NOT NULL COMMENT '活动价格',

  7. `goods_num` int(10) DEFAULT '1' COMMENT '商品参加活动数',

  8. `buy_limit` int(11) NOT NULL DEFAULT '1' COMMENT '每人限购数',

  9. `buy_num` int(11) NOT NULL DEFAULT '0' COMMENT '已购买人数',

  10. `order_num` int(10) DEFAULT '0' COMMENT '已下单数',

  11. `description` text COMMENT '活动描述',

  12. `start_time` int(11) NOT NULL COMMENT '开始时间',

  13. `end_time` int(11) NOT NULL COMMENT '结束时间',

  14. `is_end` tinyint(1) DEFAULT '0' COMMENT '是否已结束',

  15. `goods_name` varchar(255) DEFAULT NULL COMMENT '商品名称',

  16. PRIMARY KEY (`id`)

  17. ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;

  • 1

 

 

 

9、活动商品表 tp_goods_activity

 
  1. CREATE TABLE `tp_goods_activity` (

  2. `act_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '活动ID',

  3. `act_name` varchar(255) NOT NULL DEFAULT '' COMMENT '活动名称',

  4. `act_desc` text NOT NULL COMMENT '活动描述',

  5. `act_type` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '活动类型:1预售2拼团',

  6. `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '参加活动商品ID',

  7. `spec_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '商品规格ID',

  8. `goods_name` varchar(255) NOT NULL DEFAULT '' COMMENT '商品名称',

  9. `start_time` int(10) unsigned NOT NULL COMMENT '活动开始时间',

  10. `end_time` int(10) unsigned NOT NULL COMMENT '活动结束时间',

  11. `is_finished` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否已结束:0,正常;1,成功结束;2,失败结束。',

  12. `ext_info` text NOT NULL COMMENT '活动扩展配置',

  13. `act_count` mediumint(8) NOT NULL DEFAULT '0' COMMENT '商品购买数',

  14. PRIMARY KEY (`act_id`),

  15. KEY `act_name` (`act_name`,`act_type`,`goods_id`)

  16. ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

  • 1

 

 

 

10、商品属性对应表 tp_goods_attr

用于商品详情页的属性展示,与商品价格无关,商品价格根据商品规格直接关联

 
  1. CREATE TABLE `tp_goods_attr` (

  2. `goods_attr_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '商品属性id自增',

  3. `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',

  4. `attr_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '属性id',

  5. `attr_value` text NOT NULL COMMENT '属性值',

  6. `attr_price` varchar(255) NOT NULL DEFAULT '' COMMENT '属性价格',

  7. PRIMARY KEY (`goods_attr_id`),

  8. KEY `goods_id` (`goods_id`),

  9. KEY `attr_id` (`attr_id`)

  10. ) ENGINE=InnoDB AUTO_INCREMENT=999 DEFAULT CHARSET=utf8;

  • 1

 

 

 

 

11、商品属性表 tp_goods_attribute

 
  1. CREATE TABLE `tp_goods_attribute` (

  2. `attr_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '属性id',

  3. `attr_name` varchar(60) NOT NULL DEFAULT '' COMMENT '属性名称',

  4. `type_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '属性分类id',

  5. `attr_index` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0不需要检索 1关键字检索 2范围检索',

  6. `attr_type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0唯一属性 1单选属性 2复选属性',

  7. `attr_input_type` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT ' 0 手工录入 1从列表中选择 2多行文本框',

  8. `attr_values` text NOT NULL COMMENT '可选值列表',

  9. `order` tinyint(3) unsigned NOT NULL DEFAULT '50' COMMENT '属性排序',

  10. PRIMARY KEY (`attr_id`),

  11. KEY `cat_id` (`type_id`)

  12. ) ENGINE=InnoDB AUTO_INCREMENT=329 DEFAULT CHARSET=utf8;

  • 1

 

 

 

12、商品分类表 tp_goods_category

 
  1. CREATE TABLE `tp_goods_category` (

  2. `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT '商品分类id',

  3. `name` varchar(90) NOT NULL DEFAULT '' COMMENT '商品分类名称',

  4. `mobile_name` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT '手机端显示的商品分类名',

  5. `parent_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '父id',

  6. `parent_id_path` varchar(128) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT '家族图谱',

  7. `level` tinyint(1) DEFAULT '0' COMMENT '等级',

  8. `sort_order` tinyint(1) unsigned NOT NULL DEFAULT '50' COMMENT '顺序排序',

  9. `is_show` tinyint(1) unsigned NOT NULL DEFAULT '1' COMMENT '是否显示',

  10. `image` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT '分类图片',

  11. `is_hot` tinyint(1) DEFAULT '0' COMMENT '是否推荐为热门分类',

  12. `cat_group` tinyint(1) DEFAULT '0' COMMENT '分类分组默认0',

  13. `commission_rate` tinyint(1) DEFAULT '0' COMMENT '分佣比例',

  14. PRIMARY KEY (`id`),

  15. KEY `parent_id` (`parent_id`)

  16. ) ENGINE=InnoDB AUTO_INCREMENT=844 DEFAULT CHARSET=utf8;

  • 1

 

 

 

13、收藏表 tp_goods_collect

 
  1. CREATE TABLE `tp_goods_collect` (

  2. `collect_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '表id',

  3. `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',

  4. `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',

  5. `add_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间',

  6. PRIMARY KEY (`collect_id`),

  7. KEY `user_id` (`user_id`),

  8. KEY `goods_id` (`goods_id`)

  9. ) ENGINE=InnoDB AUTO_INCREMENT=247 DEFAULT CHARSET=utf8;

  • 1

 

 

 

14、商品图片表 tp_goods_images

 
  1. CREATE TABLE `tp_goods_images` (

  2. `img_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '图片id 自增',

  3. `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',

  4. `image_url` varchar(255) NOT NULL DEFAULT '' COMMENT '图片地址',

  5. PRIMARY KEY (`img_id`),

  6. KEY `goods_id` (`goods_id`)

  7. ) ENGINE=InnoDB AUTO_INCREMENT=549 DEFAULT CHARSET=utf8;

  • 1

 

 

 

15、商品类型表 tp_goods_type

 
  1. CREATE TABLE `tp_goods_type` (

  2. `id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id自增',

  3. `name` varchar(60) NOT NULL DEFAULT '' COMMENT '类型名称',

  4. PRIMARY KEY (`id`)

  5. ) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8;

  • 1

 

 

 

16、商品浏览历史表 tp_goods_visit

 
  1. CREATE TABLE `tp_goods_visit` (

  2. `visit_id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增ID',

  3. `goods_id` int(11) NOT NULL COMMENT '商品ID',

  4. `user_id` int(11) NOT NULL COMMENT '会员ID',

  5. `visittime` int(11) NOT NULL COMMENT '浏览时间',

  6. `cat_id` int(11) NOT NULL COMMENT '商品分类ID',

  7. `extend_cat_id` int(11) NOT NULL COMMENT '商品扩展分类ID',

  8. PRIMARY KEY (`goods_id`,`user_id`,`visit_id`),

  9. KEY `visit_id` (`visit_id`),

  10. KEY `user_id` (`user_id`)

  11. ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 COMMENT='商品浏览历史表';

  • 1

 

 

 

17、团购表 tp_group_buy

 
  1. CREATE TABLE `tp_group_buy` (

  2. `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '团购ID',

  3. `title` varchar(255) NOT NULL DEFAULT '' COMMENT '活动名称',

  4. `start_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '开始时间',

  5. `end_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '结束时间',

  6. `goods_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商品ID',

  7. `item_id` bigint(20) DEFAULT '0' COMMENT '对应spec_goods_price商品规格id',

  8. `price` decimal(10,2) NOT NULL COMMENT '团购价格',

  9. `goods_num` int(10) DEFAULT '0' COMMENT '商品参团数',

  10. `buy_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '商品已购买数',

  11. `order_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '已下单人数',

  12. `virtual_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '虚拟购买数',

  13. `rebate` decimal(10,1) NOT NULL COMMENT '折扣',

  14. `intro` text COMMENT '本团介绍',

  15. `goods_price` decimal(10,2) NOT NULL COMMENT '商品原价',

  16. `goods_name` varchar(200) NOT NULL DEFAULT '' COMMENT '商品名称',

  17. `recommended` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否推荐 0.未推荐 1.已推荐',

  18. `views` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '查看次数',

  19. `is_end` tinyint(1) DEFAULT '0' COMMENT '是否结束',

  20. PRIMARY KEY (`id`)

  21. ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='团购商品表';

  • 1

 

 

 

 

18、订单表 tp_order

 
  1. CREATE TABLE `tp_order` (

  2. `order_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '订单id',

  3. `order_sn` varchar(20) NOT NULL DEFAULT '' COMMENT '订单编号',

  4. `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',

  5. `order_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '订单状态',

  6. `shipping_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '发货状态',

  7. `pay_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付状态',

  8. `consignee` varchar(60) NOT NULL DEFAULT '' COMMENT '收货人',

  9. `country` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '国家',

  10. `province` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '省份',

  11. `city` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '城市',

  12. `district` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '县区',

  13. `twon` int(11) DEFAULT '0' COMMENT '乡镇',

  14. `address` varchar(255) NOT NULL DEFAULT '' COMMENT '地址',

  15. `zipcode` varchar(60) NOT NULL DEFAULT '' COMMENT '邮政编码',

  16. `mobile` varchar(60) NOT NULL DEFAULT '' COMMENT '手机',

  17. `email` varchar(60) NOT NULL DEFAULT '' COMMENT '邮件',

  18. `shipping_code` varchar(32) NOT NULL DEFAULT '' COMMENT '物流code',

  19. `shipping_name` varchar(120) NOT NULL DEFAULT '' COMMENT '物流名称',

  20. `pay_code` varchar(32) NOT NULL DEFAULT '' COMMENT '支付code',

  21. `pay_name` varchar(120) NOT NULL DEFAULT '' COMMENT '支付方式名称',

  22. `invoice_title` varchar(256) DEFAULT '' COMMENT '发票抬头',

  23. `goods_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '商品总价',

  24. `shipping_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '邮费',

  25. `user_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '使用余额',

  26. `coupon_price` decimal(10,2) DEFAULT '0.00' COMMENT '优惠券抵扣',

  27. `integral` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '使用积分',

  28. `integral_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '使用积分抵多少钱',

  29. `order_amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '应付款金额',

  30. `total_amount` decimal(10,2) DEFAULT '0.00' COMMENT '订单总价',

  31. `add_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '下单时间',

  32. `shipping_time` int(11) DEFAULT '0' COMMENT '最后新发货时间',

  33. `confirm_time` int(10) DEFAULT '0' COMMENT '收货确认时间',

  34. `pay_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付时间',

  35. `transaction_id` varchar(255) DEFAULT NULL COMMENT '第三方平台交易流水号',

  36. `order_prom_type` tinyint(4) DEFAULT '0' COMMENT '0默认1抢购2团购3优惠4预售5虚拟6拼团',

  37. `order_prom_id` smallint(6) NOT NULL DEFAULT '0' COMMENT '活动id',

  38. `order_prom_amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '活动优惠金额',

  39. `discount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '价格调整',

  40. `user_note` varchar(255) NOT NULL DEFAULT '' COMMENT '用户备注',

  41. `admin_note` varchar(255) DEFAULT '' COMMENT '管理员备注',

  42. `parent_sn` varchar(100) DEFAULT NULL COMMENT '父单单号',

  43. `is_distribut` tinyint(1) DEFAULT '0' COMMENT '是否已分成0未分成1已分成',

  44. `paid_money` decimal(10,2) DEFAULT '0.00' COMMENT '订金',

  45. `deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '用户假删除标识,1:删除,0未删除',

  46. PRIMARY KEY (`order_id`),

  47. UNIQUE KEY `order_sn` (`order_sn`),

  48. KEY `user_id` (`user_id`),

  49. KEY `add_time` (`add_time`)

  50. ) ENGINE=InnoDB AUTO_INCREMENT=1509 DEFAULT CHARSET=utf8;

  • 1

 

 

 

19、订单备注表 tp_order_action

 
  1. CREATE TABLE `tp_order_action` (

  2. `action_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '表id',

  3. `order_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '订单ID',

  4. `action_user` int(11) DEFAULT '0' COMMENT '操作人 0 为用户操作,其他为管理员id',

  5. `order_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '订单状态',

  6. `shipping_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '配送状态',

  7. `pay_status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '支付状态',

  8. `action_note` varchar(255) NOT NULL DEFAULT '' COMMENT '操作备注',

  9. `log_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '操作时间',

  10. `status_desc` varchar(255) DEFAULT NULL COMMENT '状态描述',

  11. PRIMARY KEY (`action_id`),

  12. KEY `order_id` (`order_id`)

  13. ) ENGINE=InnoDB AUTO_INCREMENT=2195 DEFAULT CHARSET=utf8;

  • 1

 

 

 

20、订单商品表 tp_order_goods

 
  1. CREATE TABLE `tp_order_goods` (

  2. `rec_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '表id自增',

  3. `order_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '订单id',

  4. `goods_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',

  5. `goods_name` varchar(120) NOT NULL DEFAULT '' COMMENT '视频名称',

  6. `goods_sn` varchar(60) NOT NULL DEFAULT '' COMMENT '商品货号',

  7. `goods_num` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT '购买数量',

  8. `market_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '市场价',

  9. `goods_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '本店价',

  10. `cost_price` decimal(10,2) DEFAULT '0.00' COMMENT '商品成本价',

  11. `member_goods_price` decimal(10,2) DEFAULT '0.00' COMMENT '会员折扣价',

  12. `give_integral` mediumint(8) DEFAULT '0' COMMENT '购买商品赠送积分',

  13. `spec_key` varchar(128) DEFAULT '' COMMENT '商品规格key',

  14. `spec_key_name` varchar(128) DEFAULT '' COMMENT '规格对应的中文名字',

  15. `bar_code` varchar(64) NOT NULL DEFAULT '' COMMENT '条码',

  16. `is_comment` tinyint(1) DEFAULT '0' COMMENT '是否评价',

  17. `prom_type` tinyint(1) DEFAULT '0' COMMENT '0 普通订单,1 限时抢购, 2 团购 , 3 促销优惠,4预售',

  18. `prom_id` int(11) DEFAULT '0' COMMENT '活动id',

  19. `is_send` tinyint(1) DEFAULT '0' COMMENT '0未发货,1已发货,2已换货,3已退货',

  20. `delivery_id` int(11) DEFAULT '0' COMMENT '发货单ID',

  21. `sku` varchar(128) DEFAULT '' COMMENT 'sku',

  22. PRIMARY KEY (`rec_id`),

  23. KEY `order_id` (`order_id`),

  24. KEY `goods_id` (`goods_id`)

  25. ) ENGINE=InnoDB AUTO_INCREMENT=1773 DEFAULT CHARSET=utf8;

  • 1

 

 

 

 

21、支付表 tp_payment

 
  1. CREATE TABLE `tp_payment` (

  2. `pay_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT COMMENT '表id',

  3. `pay_code` varchar(20) NOT NULL DEFAULT '' COMMENT '支付code',

  4. `pay_name` varchar(120) NOT NULL DEFAULT '' COMMENT '支付方式名称',

  5. `pay_fee` varchar(10) NOT NULL DEFAULT '' COMMENT '手续费',

  6. `pay_desc` text NOT NULL COMMENT '描述',

  7. `pay_order` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'pay_coder',

  8. `pay_config` text NOT NULL COMMENT '配置',

  9. `enabled` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '开启',

  10. `is_cod` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否货到付款',

  11. `is_online` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否在线支付',

  12. PRIMARY KEY (`pay_id`),

  13. UNIQUE KEY `pay_code` (`pay_code`)

  14. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

  • 1

 

 

 

22、退换货表 tp_return_goods

 
  1. CREATE TABLE `tp_return_goods` (

  2. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '退货申请表id自增',

  3. `rec_id` int(11) DEFAULT '0' COMMENT 'order_goods表id',

  4. `order_id` int(11) DEFAULT '0' COMMENT '订单id',

  5. `order_sn` varchar(1024) CHARACTER SET utf8 DEFAULT '' COMMENT '订单编号',

  6. `goods_id` int(11) DEFAULT '0' COMMENT '商品id',

  7. `goods_num` int(10) DEFAULT '1' COMMENT '退货数量',

  8. `type` tinyint(1) DEFAULT '0' COMMENT '0退货1换货',

  9. `reason` varchar(255) CHARACTER SET utf8 DEFAULT '' COMMENT '退换货原因',

  10. `describe` varchar(255) CHARACTER SET utf8 DEFAULT '' COMMENT '问题描述',

  11. `imgs` varchar(512) CHARACTER SET utf8 DEFAULT '' COMMENT '拍照图片路径',

  12. `addtime` int(11) DEFAULT '0' COMMENT '申请时间',

  13. `status` tinyint(1) DEFAULT '0' COMMENT '-2用户取消-1审核不通过0待审核1通过2已发货3已完成',

  14. `remark` varchar(1024) CHARACTER SET utf8 DEFAULT '' COMMENT '客服备注',

  15. `user_id` int(11) DEFAULT '0' COMMENT '用户id',

  16. `spec_key` varchar(64) CHARACTER SET utf8 DEFAULT '' COMMENT '商品规格key 对应tp_spec_goods_price 表',

  17. `seller_delivery` text CHARACTER SET utf8 COMMENT '换货服务,卖家重新发货信息',

  18. `refund_money` decimal(10,2) DEFAULT '0.00' COMMENT '退还金额',

  19. `refund_deposit` decimal(10,2) DEFAULT '0.00' COMMENT '退还余额',

  20. `refund_integral` int(11) DEFAULT '0' COMMENT '退还积分',

  21. `refund_type` tinyint(1) DEFAULT '0' COMMENT '退款类型',

  22. `refund_mark` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '退款备注',

  23. `refund_time` int(11) DEFAULT '0' COMMENT '退款时间',

  24. `is_receive` tinyint(4) DEFAULT '0' COMMENT '申请售后时是否收到货物',

  25. PRIMARY KEY (`id`),

  26. KEY `user_id` (`user_id`)

  27. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

  • 1

 

 

 

23、规格表 tp_spec

 
  1. CREATE TABLE `tp_spec` (

  2. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '规格表',

  3. `type_id` int(11) DEFAULT '0' COMMENT '规格类型',

  4. `name` varchar(55) DEFAULT NULL COMMENT '规格名称',

  5. `order` int(11) DEFAULT '50' COMMENT '排序',

  6. `search_index` tinyint(1) DEFAULT '1' COMMENT '是否需要检索:1是,0否',

  7. PRIMARY KEY (`id`)

  8. ) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8;

  • 1

 

 

 

24、规格图片表 tp_spec_image

 
  1. CREATE TABLE `tp_spec_image` (

  2. `goods_id` int(11) DEFAULT '0' COMMENT '商品规格图片表id',

  3. `spec_image_id` int(11) DEFAULT '0' COMMENT '规格项id',

  4. `src` varchar(512) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT '商品规格图片路径'

  5. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

  • 1

 

 

25、规格项表 

 
  1. CREATE TABLE `tp_spec_item` (

  2. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '规格项id',

  3. `spec_id` int(11) DEFAULT NULL COMMENT '规格id',

  4. `item` varchar(54) DEFAULT NULL COMMENT '规格项',

  5. PRIMARY KEY (`id`)

  6. ) ENGINE=InnoDB AUTO_INCREMENT=114 DEFAULT CHARSET=utf8;

  • 1

 

 

 

26、后台更改商品库存记录表 tp_stock_log

 
  1. CREATE TABLE `tp_stock_log` (

  2. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,

  3. `goods_id` int(11) DEFAULT NULL COMMENT '商品ID',

  4. `goods_name` varchar(100) DEFAULT NULL COMMENT '商品名称',

  5. `goods_spec` varchar(50) DEFAULT NULL COMMENT '商品规格',

  6. `order_sn` varchar(30) DEFAULT NULL COMMENT '订单编号',

  7. `muid` int(11) DEFAULT NULL COMMENT '操作用户ID',

  8. `stock` int(11) DEFAULT NULL COMMENT '更改库存',

  9. `ctime` int(11) DEFAULT NULL COMMENT '操作时间',

  10. PRIMARY KEY (`id`)

  11. ) ENGINE=InnoDB AUTO_INCREMENT=331 DEFAULT CHARSET=utf8;

  • 1

 

 

 

 

27、收货地址表 tp_user_address

 
  1. CREATE TABLE `tp_user_address` (

  2. `address_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '表id',

  3. `user_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',

  4. `consignee` varchar(60) NOT NULL DEFAULT '' COMMENT '收货人',

  5. `email` varchar(60) NOT NULL DEFAULT '' COMMENT '邮箱地址',

  6. `country` int(11) NOT NULL DEFAULT '0' COMMENT '国家',

  7. `province` int(11) NOT NULL DEFAULT '0' COMMENT '省份',

  8. `city` int(11) NOT NULL DEFAULT '0' COMMENT '城市',

  9. `district` int(11) NOT NULL DEFAULT '0' COMMENT '地区',

  10. `twon` int(11) DEFAULT '0' COMMENT '乡镇',

  11. `address` varchar(120) NOT NULL DEFAULT '' COMMENT '地址',

  12. `zipcode` varchar(60) NOT NULL DEFAULT '' COMMENT '邮政编码',

  13. `mobile` varchar(60) NOT NULL DEFAULT '' COMMENT '手机',

  14. `is_default` tinyint(1) DEFAULT '0' COMMENT '默认收货地址',

  15. `is_pickup` tinyint(1) DEFAULT '0',

  16. PRIMARY KEY (`address_id`),

  17. KEY `user_id` (`user_id`)

  18. ) ENGINE=InnoDB AUTO_INCREMENT=829 DEFAULT CHARSET=utf8;

  • 1

 

 

 

28、用户等级表

 
  1. CREATE TABLE `tp_user_level` (

  2. `level_id` smallint(4) unsigned NOT NULL AUTO_INCREMENT COMMENT '表id',

  3. `level_name` varchar(30) DEFAULT NULL COMMENT '头衔名称',

  4. `amount` decimal(10,2) DEFAULT NULL COMMENT '等级必要金额',

  5. `discount` smallint(4) DEFAULT '0' COMMENT '折扣',

  6. `describe` varchar(200) DEFAULT NULL COMMENT '头街 描述',

  7. PRIMARY KEY (`level_id`)

  8. ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;

  • 1

 

 

 

29、用户信息表 tp_users

 
  1. CREATE TABLE `tp_users` (

  2. `user_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '表id',

  3. `email` varchar(60) NOT NULL DEFAULT '' COMMENT '邮件',

  4. `password` varchar(32) NOT NULL DEFAULT '' COMMENT '密码',

  5. `paypwd` varchar(32) DEFAULT NULL COMMENT '支付密码',

  6. `sex` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '0 保密 1 男 2 女',

  7. `birthday` int(11) NOT NULL DEFAULT '0' COMMENT '生日',

  8. `user_money` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '用户金额',

  9. `frozen_money` decimal(10,2) DEFAULT '0.00' COMMENT '冻结金额',

  10. `distribut_money` decimal(10,2) DEFAULT '0.00' COMMENT '累积分佣金额',

  11. `underling_number` int(5) DEFAULT '0' COMMENT '用户下线总数',

  12. `pay_points` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '消费积分',

  13. `address_id` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '默认收货地址',

  14. `reg_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '注册时间',

  15. `last_login` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '最后登录时间',

  16. `last_ip` varchar(15) NOT NULL DEFAULT '' COMMENT '最后登录ip',

  17. `qq` varchar(20) NOT NULL DEFAULT '' COMMENT 'QQ',

  18. `mobile` varchar(20) NOT NULL DEFAULT '' COMMENT '手机号码',

  19. `mobile_validated` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否验证手机',

  20. `oauth` varchar(10) DEFAULT '' COMMENT '第三方来源 wx weibo alipay',

  21. `openid` varchar(100) DEFAULT NULL COMMENT '第三方唯一标示',

  22. `unionid` varchar(100) DEFAULT NULL,

  23. `head_pic` varchar(255) DEFAULT NULL COMMENT '头像',

  24. `province` int(6) DEFAULT '0' COMMENT '省份',

  25. `city` int(6) DEFAULT '0' COMMENT '市区',

  26. `district` int(6) DEFAULT '0' COMMENT '县',

  27. `email_validated` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否验证电子邮箱',

  28. `nickname` varchar(50) DEFAULT NULL COMMENT '第三方返回昵称',

  29. `level` tinyint(1) DEFAULT '1' COMMENT '会员等级',

  30. `discount` decimal(10,2) DEFAULT '1.00' COMMENT '会员折扣,默认1不享受',

  31. `total_amount` decimal(10,2) DEFAULT '0.00' COMMENT '消费累计额度',

  32. `is_lock` tinyint(1) DEFAULT '0' COMMENT '是否被锁定冻结',

  33. `is_distribut` tinyint(1) DEFAULT '0' COMMENT '是否为分销商 0 否 1 是',

  34. `first_leader` int(11) DEFAULT '0' COMMENT '第一个上级',

  35. `second_leader` int(11) DEFAULT '0' COMMENT '第二个上级',

  36. `third_leader` int(11) DEFAULT '0' COMMENT '第三个上级',

  37. `token` varchar(64) DEFAULT '' COMMENT '用于app 授权类似于session_id',

  38. `message_mask` tinyint(1) NOT NULL DEFAULT '63' COMMENT '消息掩码',

  39. `push_id` varchar(30) NOT NULL DEFAULT '' COMMENT '推送id',

  40. `distribut_level` tinyint(2) DEFAULT '0' COMMENT '分销商等级',

  41. PRIMARY KEY (`user_id`),

  42. KEY `email` (`email`),

  43. KEY `underling_number` (`underling_number`),

  44. KEY `mobile` (`mobile_validated`),

  45. KEY `openid` (`openid`),

  46. KEY `unionid` (`unionid`)

  47. ) ENGINE=InnoDB AUTO_INCREMENT=2594 DEFAULT CHARSET=utf8;

  • 1

 

 

 

30、用户充值记录表 tp_recharge

 
  1. CREATE TABLE `tp_recharge` (

  2. `order_id` bigint(20) NOT NULL AUTO_INCREMENT,

  3. `user_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '会员ID',

  4. `nickname` varchar(50) DEFAULT NULL COMMENT '会员昵称',

  5. `order_sn` varchar(30) NOT NULL DEFAULT '' COMMENT '充值单号',

  6. `account` float(10,2) DEFAULT '0.00' COMMENT '充值金额',

  7. `ctime` int(11) DEFAULT NULL COMMENT '充值时间',

  8. `pay_time` int(11) DEFAULT NULL COMMENT '支付时间',

  9. `pay_code` varchar(20) DEFAULT NULL,

  10. `pay_name` varchar(80) DEFAULT NULL COMMENT '支付方式',

  11. `pay_status` tinyint(1) DEFAULT '0' COMMENT '充值状态0:待支付 1:充值成功 2:交易关闭',

  12. PRIMARY KEY (`order_id`)

  13. ) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=utf8;

  • 1

 

 

 

31、用户扩展信息表 tp_user_extend

 
  1. CREATE TABLE `tp_user_extend` (

  2. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,

  3. `user_id` int(11) unsigned DEFAULT '0',

  4. `invoice_title` varchar(200) CHARACTER SET utf8 DEFAULT NULL COMMENT '发票抬头',

  5. `taxpayer` varchar(100) CHARACTER SET utf8 DEFAULT NULL COMMENT '纳税人识别号',

  6. `invoice_desc` varchar(50) CHARACTER SET utf8 DEFAULT NULL COMMENT '不开发票/明细',

  7. `realname` varchar(100) CHARACTER SET utf8 DEFAULT NULL COMMENT '真实姓名',

  8. `idcard` varchar(100) CHARACTER SET utf8 DEFAULT NULL COMMENT '身份证号',

  9. PRIMARY KEY (`id`)

  10. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

  • 1

 

 

 

 

32、用户提现申请表 tp_withdrawals

 
  1. CREATE TABLE `tp_withdrawals` (

  2. `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '提现申请表',

  3. `user_id` int(11) DEFAULT '0' COMMENT '用户id',

  4. `money` decimal(10,2) DEFAULT '0.00' COMMENT '提现金额',

  5. `create_time` int(11) DEFAULT '0' COMMENT '申请时间',

  6. `check_time` int(11) DEFAULT '0' COMMENT '审核时间',

  7. `pay_time` int(11) DEFAULT '0' COMMENT '支付时间',

  8. `refuse_time` int(11) DEFAULT '0' COMMENT '拒绝时间',

  9. `bank_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT '银行名称 如支付宝 微信 中国银行 农业银行等',

  10. `bank_card` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT '银行账号或支付宝账号',

  11. `realname` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT '提款账号真实姓名',

  12. `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT '提现备注',

  13. `taxfee` decimal(10,2) DEFAULT '0.00' COMMENT '税收手续费',

  14. `status` tinyint(1) DEFAULT '0' COMMENT '状态:-2删除作废-1审核失败0申请中1审核通过2付款成功3付款失败',

  15. `pay_code` varchar(100) DEFAULT NULL COMMENT '付款对账流水号',

  16. `error_code` varchar(255) DEFAULT NULL COMMENT '付款失败错误代码',

  17. PRIMARY KEY (`id`)

  18. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

  • 1

 

 

 

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值