v1.1.27.sql 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. START TRANSACTION;
  2. CREATE TABLE `yoshop_bargain_active` (
  3. `active_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '砍价活动id',
  4. `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  5. `start_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '活动开始时间',
  6. `end_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '活动结束时间',
  7. `expiryt_time` int(11) unsigned NOT NULL DEFAULT '1' COMMENT '砍价有效期(单位:小时)',
  8. `floor_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '砍价底价',
  9. `peoples` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '帮砍人数',
  10. `is_self_cut` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '可自砍一刀(0禁止 1允许)',
  11. `is_floor_buy` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '必须底价购买(0否 1是)',
  12. `share_title` varchar(500) NOT NULL DEFAULT '' COMMENT '分享标题',
  13. `prompt_words` varchar(500) NOT NULL DEFAULT '' COMMENT '砍价助力语',
  14. `actual_sales` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '活动销量(实际的)',
  15. `initial_sales` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '虚拟销量',
  16. `sort` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '排序(数字越小越靠前)',
  17. `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '活动状态(1启用 0禁用)',
  18. `is_delete` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除',
  19. `wxapp_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '小程序id',
  20. `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  21. `update_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  22. PRIMARY KEY (`active_id`)
  23. ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COMMENT='砍价活动表';
  24. CREATE TABLE `yoshop_bargain_setting` (
  25. `key` varchar(30) NOT NULL DEFAULT '' COMMENT '设置项标示',
  26. `describe` varchar(255) NOT NULL DEFAULT '' COMMENT '设置项描述',
  27. `values` mediumtext NOT NULL COMMENT '设置内容(json格式)',
  28. `wxapp_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '小程序id',
  29. `update_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  30. UNIQUE KEY `unique_key` (`key`,`wxapp_id`)
  31. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='砍价活动设置表';
  32. CREATE TABLE `yoshop_bargain_task` (
  33. `task_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '砍价任务id',
  34. `active_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '砍价活动id',
  35. `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id(发起人)',
  36. `goods_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '商品id',
  37. `spec_sku_id` varchar(255) NOT NULL DEFAULT '' COMMENT '商品sku标识',
  38. `goods_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '商品原价',
  39. `floor_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '砍价底价',
  40. `peoples` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '帮砍人数',
  41. `cut_people` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '已砍人数',
  42. `section` text NOT NULL COMMENT '砍价金额区间',
  43. `cut_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '已砍金额',
  44. `actual_price` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '实际购买金额',
  45. `is_floor` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否已砍到底价(0否 1是)',
  46. `end_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '任务截止时间',
  47. `is_buy` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否购买(0未购买 1已购买)',
  48. `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '任务状态 (0已结束 1砍价中)',
  49. `is_delete` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除',
  50. `wxapp_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '小程序id',
  51. `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  52. `update_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  53. PRIMARY KEY (`task_id`)
  54. ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COMMENT='砍价任务表';
  55. CREATE TABLE `yoshop_bargain_task_help` (
  56. `help_id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键id',
  57. `active_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '砍价活动id',
  58. `task_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '砍价任务id',
  59. `user_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '用户id',
  60. `is_creater` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '是否为发起人(0否 1是)',
  61. `cut_money` decimal(10,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '砍掉的金额',
  62. `wxapp_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '小程序id',
  63. `create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  64. PRIMARY KEY (`help_id`)
  65. ) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COMMENT='砍价任务助力记录表';
  66. ALTER TABLE `yoshop_order`
  67. ADD COLUMN `order_source` tinyint(3) UNSIGNED NOT NULL DEFAULT 10 COMMENT '订单来源(10普通订单 20砍价订单)' AFTER `is_comment`;
  68. ALTER TABLE `yoshop_order`
  69. ADD COLUMN `order_source_id` int(11) UNSIGNED NOT NULL DEFAULT 0 COMMENT '来源记录id' AFTER `order_source`;
  70. INSERT INTO `yoshop_store_access` VALUES ('10426', '砍价活动', 'apps.bargain', '10074', '100', '1559615418', '1559615441');
  71. INSERT INTO `yoshop_store_access` VALUES ('10427', '砍价活动管理', 'apps.bargain.active', '10426', '100', '1559615566', '1559615566');
  72. INSERT INTO `yoshop_store_access` VALUES ('10428', '砍价活动列表', 'apps.bargain.active/index', '10427', '100', '1559615601', '1559615601');
  73. INSERT INTO `yoshop_store_access` VALUES ('10429', '新增砍价活动', 'apps.bargain.active/add', '10427', '105', '1559615601', '1559615601');
  74. INSERT INTO `yoshop_store_access` VALUES ('10430', '编辑砍价活动', 'apps.bargain.active/edit', '10427', '110', '1559615601', '1559615601');
  75. INSERT INTO `yoshop_store_access` VALUES ('10431', '删除砍价活动', 'apps.bargain.active/delete', '10427', '115', '1559615601', '1559615601');
  76. INSERT INTO `yoshop_store_access` VALUES ('10432', '砍价记录', 'apps.bargain.task', '10426', '105', '1559615788', '1559615788');
  77. INSERT INTO `yoshop_store_access` VALUES ('10433', '砍价记录列表', 'apps.bargain.task/index', '10432', '100', '1559615815', '1559615815');
  78. INSERT INTO `yoshop_store_access` VALUES ('10434', '砍价助力榜', 'apps.bargain.task/help', '10432', '105', '1559615850', '1559615850');
  79. INSERT INTO `yoshop_store_access` VALUES ('10435', '删除砍价记录', 'apps.bargain.task/delete', '10432', '110', '1559615878', '1559615878');
  80. INSERT INTO `yoshop_store_access` VALUES ('10436', '砍价设置', 'apps.bargain.setting/index', '10426', '110', '1559615946', '1559615979');
  81. INSERT INTO `yoshop_store_access` VALUES ('10437', '复制主商城商品', 'apps.sharing.goods/copy_master', '10306', '112', '1559615946', '1559615979');
  82. UPDATE `yoshop_store_access` SET `sort`='105' WHERE (`access_id`='10021');
  83. UPDATE `yoshop_store_access` SET `sort`='110' WHERE (`access_id`='10022');
  84. UPDATE `yoshop_store_access` SET `sort`='115' WHERE (`access_id`='10023');
  85. UPDATE `yoshop_store_access` SET `sort`='120' WHERE (`access_id`='10024');
  86. UPDATE `yoshop_store_access` SET `sort`='125' WHERE (`access_id`='10025');
  87. UPDATE `yoshop_store_access` SET `sort`='105' WHERE (`access_id`='10307');
  88. UPDATE `yoshop_store_access` SET `sort`='110' WHERE (`access_id`='10308');
  89. UPDATE `yoshop_store_access` SET `sort`='115' WHERE (`access_id`='10309');
  90. UPDATE `yoshop_store_access` SET `sort`='120' WHERE (`access_id`='10310');
  91. UPDATE `yoshop_store_access` SET `sort`='125' WHERE (`access_id`='10311');
  92. COMMIT;