
2022-02-14:
ALTER TABLE eb_dict_coin ADD mine_per_sec DECIMAL(8,8) DEFAULT 0.0 NOT NULL COMMENT '每秒可挖个数';
ALTER TABLE eb_dict_coin ADD status SMALLINT DEFAULT 0 NOT NULL COMMENT '0 上架但不可挖 -1 已下架 1 可挖';

2022-02-16:
ALTER TABLE eb_user ADD channel INT(8) DEFAULT 0 NOT NULL COMMENT '渠道编号';
CREATE INDEX eb_user_channel_IDX USING BTREE ON eb_user (channel);
INSERT INTO eb_dict_coin (symbol,name,icon,price,min_withdrawal,mine_per_sec,status) VALUES
	 ('PIG','PIGTOKEN','http://twongpic.shotshock.shop/logos/icon-pigg.png',0.00000120,10000.00000000,0.00000000,0),
	 ('RMB','RMB','http://twongpic.shotshock.shop/logos/rmb.png',1.00000000,1.00000000,0.00000000,0);


2022-07-29:

-- 注意一下表名前缀需要根据实际情况更改 
INSERT INTO eb_system_config_tab
(pid, title, eng_title, status, info, icon, `type`, sort)
VALUES(0, '活动配置', 'activity_config', 1, 0, 'cutlery', 0, 0);
INSERT INTO eb_system_config_tab
(pid, title, eng_title, status, info, icon, `type`, sort)
VALUES(0, '排行榜配置', 'leaderboard', 1, 0, 'cny', 0, 0);


-- 注意 config_tab_id 值为上面两条实际生成的 ID
INSERT INTO eb_system_config
(menu_name, `type`, input_type, config_tab_id, `parameter`, upload_type, required, width, high, value, info, `desc`, sort, status)
VALUES('off_days_before', 'text', 'number', 5, '', NULL, 'require:true', 100, NULL, '"60"', '自动下架天数', '上架时间超过此天数的商品自动下架，避免上游缺货，0表示不自动下架', 0, 1);
INSERT INTO eb_system_config
(menu_name, `type`, input_type, config_tab_id, `parameter`, upload_type, required, width, high, value, info, `desc`, sort, status)
VALUES('server_ip', 'text', 'input', 1, '', NULL, 'require:true', 100, NULL, '0.0.0.0', '网站IP', '主服务器IP，用于微信支付双向校验', 0, 1);
INSERT INTO eb_system_config
(menu_name, `type`, input_type, config_tab_id, `parameter`, upload_type, required, width, high, value, info, `desc`, sort, status)
VALUES('show_benefit', 'radio', 'number', 5, '0=>不显示
1=>显示', NULL, NULL, NULL, NULL, '"1"', '是否显示赔付金额', '前端商品列表中是否显示赔付多少钱', 0, 1);
INSERT INTO eb_system_config
(menu_name, `type`, input_type, config_tab_id, `parameter`, upload_type, required, width, high, value, info, `desc`, sort, status)
VALUES('notice_sender', 'text', 'input', 5, '', NULL, 'required:true', 100, NULL, '"\\u8fd0\\u8425\\u4e2d\\u5fc3"', '消息发送者名称', '客户端用户收到系统消息的发送者', 0, 1);
INSERT INTO eb_system_config
(menu_name, `type`, input_type, config_tab_id, `parameter`, upload_type, required, width, high, value, info, `desc`, sort, status)
VALUES('notice_max', 'text', 'number', 5, '', NULL, 'required:true', 100, NULL, '"30"', '消息最大条数', '客户端消息最多显示多少条', 0, 1);
INSERT INTO eb_system_config
(menu_name, `type`, input_type, config_tab_id, `parameter`, upload_type, required, width, high, value, info, `desc`, sort, status)
VALUES('extract_weixin_enabled', 'radio', 'number', 5, '1=>开启
0=>关闭', NULL, NULL, NULL, NULL, '"1"', '微信提现', '是否开启微信提现', 0, 1);
INSERT INTO eb_system_config
(menu_name, `type`, input_type, config_tab_id, `parameter`, upload_type, required, width, high, value, info, `desc`, sort, status)
VALUES('extract_weixin_bank_enabled', 'radio', 'number', 5, '1=>开启
0=>关闭', NULL, NULL, NULL, NULL, '"1"', '微信支付银行卡提现', '是否开启微信平台的银行卡提现', 0, 1);
INSERT INTO eb_system_config
(menu_name, `type`, input_type, config_tab_id, `parameter`, upload_type, required, width, high, value, info, `desc`, sort, status)
VALUES('extract_alipay_enabled', 'radio', 'number', 5, '1=>开启
0=>关闭', NULL, NULL, NULL, NULL, '"0"', '支付宝提现', '是否开启支付宝提现', 0, 1);
INSERT INTO eb_system_config
(menu_name, `type`, input_type, config_tab_id, `parameter`, upload_type, required, width, high, value, info, `desc`, sort, status)
VALUES('extract_alipay_bank_enabled', 'radio', 'number', 5, '1=>开启
0=>关闭', NULL, NULL, NULL, NULL, '"0"', '支付宝银行卡提现', '是否开启支付宝平台的银行卡提现', 0, 1);
INSERT INTO eb_system_config
(menu_name, `type`, input_type, config_tab_id, `parameter`, upload_type, required, width, high, value, info, `desc`, sort, status)
VALUES('bank_extract_free', 'radio', 'number', 24, '1=>开启
0=>关闭', NULL, NULL, NULL, NULL, '"0"', '提现免手续费', '支付平台银行卡提现有手续费，免手续费指官方垫付手续费', 0, 1);
INSERT INTO eb_system_config
(menu_name, `type`, input_type, config_tab_id, `parameter`, upload_type, required, width, high, value, info, `desc`, sort, status)
VALUES('register_money', 'text', 'number', 24, '', NULL, '', 100, NULL, '0.0', '注册送钱(元)', '注册即送多少钱', 0, 1);

INSERT INTO eb_system_config
(menu_name, `type`, input_type, config_tab_id, `parameter`, upload_type, required, width, high, value, info, `desc`, sort, status)
VALUES('leader_board_banner', 'upload', 'input', 25, '', 1, NULL, NULL, NULL, NULL, '顶部图片', '客户端排行榜页面顶部图片(750x161)', 0, 1);
INSERT INTO eb_system_config
(menu_name, `type`, input_type, config_tab_id, `parameter`, upload_type, required, width, high, value, info, `desc`, sort, status)
VALUES('leader_max_num', 'text', 'number', 25, '', NULL, '', 100, NULL, '30', '最大人数', '排行榜只显示前多少名', 0, 1);
INSERT INTO eb_system_config
(menu_name, `type`, input_type, config_tab_id, `parameter`, upload_type, required, width, high, value, info, `desc`, sort, status)
VALUES('leader_robot_earn_min', 'text', 'number', 25, '', NULL, NULL, 100, NULL, '"0"', '机器人最少返利(元)', '机器人定时下订单并获得返利，最少返利和最多返利定义了机器人单次返利范围', 0, 1);
INSERT INTO eb_system_config
(menu_name, `type`, input_type, config_tab_id, `parameter`, upload_type, required, width, high, value, info, `desc`, sort, status)
VALUES('leader_robot_earn_max', 'text', 'number', 25, '', NULL, NULL, 100, NULL, '"50"', '机器人最多返利(元)', '机器人定时下订单并获得返利，最少返利和最多返利定义了机器人单次返利范围', 0, 1);

2022-08-18

ALTER TABLE twong.eb_system_attachment CHANGE att_id id int(10) auto_increment NOT NULL;

2022-09-30

CREATE TABLE `eb_user_streaks` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) NOT NULL,
  `flag` int(2) NOT NULL DEFAULT 0 COMMENT '0 连赢 1 连输',
  `link_id` varchar(32) NOT NULL COMMENT '订单号',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_user_streaks_uid_flag` (`uid`,`flag`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

CREATE TABLE `eb_dict_channels` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL COMMENT '名称',
  `code` varchar(16) NOT NULL COMMENT '渠道代码',
  `desc` varchar(1024) NOT NULL DEFAULT '' COMMENT '渠道说明',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp(),
  PRIMARY KEY (`id`),
  KEY `idx_channels_code` (`code`),
  KEY `idx_channels_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

INSERT INTO eb_system_menus
(id, pid, icon, menu_name, module, controller, `action`, params, sort, is_show, access)
VALUES(506, 151, 'stumbleupon', '会员渠道', 'admin', 'user.user_channel', 'index', '[]', 0, 1, 1);
