install.sql 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. -- ----------------------------
  2. -- Table structure for qimall_addons_score_mall_exchange_record
  3. -- ----------------------------
  4. DROP TABLE IF EXISTS `qimall_addons_score_mall_exchange_record`;
  5. CREATE TABLE `qimall_addons_score_mall_exchange_record` (
  6. `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  7. `mall_id` int(11) NOT NULL DEFAULT 0,
  8. `user_id` int(11) NOT NULL DEFAULT 0,
  9. `goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品ID',
  10. `goods_attr_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品属性ID',
  11. `exchange_price` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '对换价格',
  12. `goods` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '商品信息',
  13. `num` int(11) NOT NULL DEFAULT 0 COMMENT '兑换数量',
  14. `order_no` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '订单号',
  15. `order_id` int(11) NOT NULL DEFAULT 0 COMMENT '订单ID',
  16. `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态[-1:删除;0:禁用;1启用]',
  17. `created_at` int(10) NOT NULL DEFAULT 0 COMMENT '创建时间',
  18. `updated_at` int(10) NOT NULL DEFAULT 0 COMMENT '更新时间',
  19. PRIMARY KEY (`id`) USING BTREE,
  20. INDEX `user_mall_id`(`user_id`, `mall_id`) USING BTREE,
  21. INDEX `goods_id`(`goods_id`) USING BTREE,
  22. INDEX `order_no`(`order_no`) USING BTREE
  23. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '积分商城兑换记录表' ROW_FORMAT = DYNAMIC;
  24. -- ----------------------------
  25. -- Table structure for qimall_addons_score_mall_goods
  26. -- ----------------------------
  27. DROP TABLE IF EXISTS `qimall_addons_score_mall_goods`;
  28. CREATE TABLE `qimall_addons_score_mall_goods` (
  29. `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  30. `mall_id` int(11) NOT NULL DEFAULT 0,
  31. `goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品ID',
  32. `cate_id` int(11) NOT NULL DEFAULT 0 COMMENT '分类ID',
  33. `score` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT 'type=1,2时消耗的积分',
  34. `money` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT 'type=2时,商品价格',
  35. `price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '商品售价,对应goods表price',
  36. `type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1:全积分兑换,2:积分加金额,3:积分抵扣',
  37. `num` int(11) NOT NULL DEFAULT 0 COMMENT '已兑换数量',
  38. `use_coupon` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否不参加优惠券抵扣,0:参加,1:不参加',
  39. `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态[-1:删除;0:禁用;1启用]',
  40. `created_at` int(10) NOT NULL DEFAULT 0 COMMENT '创建时间',
  41. `updated_at` int(10) NOT NULL DEFAULT 0 COMMENT '更新时间',
  42. PRIMARY KEY (`id`) USING BTREE,
  43. INDEX `goods_id`(`goods_id`) USING BTREE
  44. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '积分商城商品表' ROW_FORMAT = DYNAMIC;
  45. -- ----------------------------
  46. -- Table structure for qimall_addons_score_mall_goods_attr
  47. -- ----------------------------
  48. DROP TABLE IF EXISTS `qimall_addons_score_mall_goods_attr`;
  49. CREATE TABLE `qimall_addons_score_mall_goods_attr` (
  50. `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  51. `goods_id` int(11) NOT NULL DEFAULT 0 COMMENT '商品ID',
  52. `goods_attr_id` int(11) NOT NULL DEFAULT 0 COMMENT '规格ID',
  53. `score` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT 'type=1,2时消耗的积分',
  54. `money` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '商品价格',
  55. `price` decimal(10, 2) NOT NULL DEFAULT 0.00 COMMENT '商品售价,对应goodsAttr表price',
  56. `deduction_limit` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'type=3时[{最少抵扣积分:score,是否限制抵扣:0or1}]',
  57. `status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态[-1:删除;0:禁用;1启用]',
  58. `created_at` int(10) NOT NULL DEFAULT 0 COMMENT '创建时间',
  59. `updated_at` int(10) NOT NULL DEFAULT 0 COMMENT '更新时间',
  60. PRIMARY KEY (`id`) USING BTREE,
  61. INDEX `goods_id`(`goods_id`) USING BTREE,
  62. INDEX `goods_attr_id`(`goods_attr_id`) USING BTREE
  63. ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '积分商城商品规格表' ROW_FORMAT = DYNAMIC;
  64. -- ----------------------------
  65. -- 链接分类
  66. -- ----------------------------
  67. INSERT INTO `qimall_link_category` ( `name`, `title`, `pid`, `is_list`, `remark`, `status`, `created_at`, `updated_at`) VALUES
  68. ( 'score_mall', '积分商品', 19, 1, NULL, 1, 1641814024, 1641814024),
  69. ( 'score_mall_cate', '积分商品分类', 19, 1, NULL, 1, 1641814039, 1641814039);
  70. -- ----------------------------
  71. -- 装修组件
  72. -- ----------------------------
  73. INSERT INTO `qimall_diy_components` (`code`, `title`, `group`, `icon`, `count`, `is_top`, `permission`, `sort`, `source`, `status`, `created_at`, `updated_at`) VALUES
  74. ('score-mall', '积分商品', 'marketing', '', 999, 0, '{\"is_drag\":\"true\",\"is_up\":\"true\",\"id_down\":\"true\",\"is_copy\":\"true\"}', 999, 'ScoreMall', 1, 1634538238, 1634538238);