APP升级分为两种类型
CREATE TABLE `t_app_version` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`os` tinyint(1) NOT NULL DEFAULT '0' COMMENT '系统 0:Android;1:IOS;',
`version` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '版本号',
`version_seq` int NOT NULL DEFAULT '1' COMMENT '版本顺序号',
`version_desc` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '版本描述',
`download_url` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '版本下载地址,只有Android需要',
`online_time` datetime NOT NULL COMMENT '上线时间',
`forced_update` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否强制更新 0:询问更新; 1:强制更新。',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime NOT NULL COMMENT '更新时间',
`is_delete` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除 0:未删除;1:删除;',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `uk_os_version_seq` (`os`,`version_seq`),
KEY `idx_online_time` (`online_time`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='APP版本信息';
INSERT INTO `t_app_version` (`id`, `os`, `version`, `version_seq`, `version_desc`, `download_url`, `online_time`, `forced_update`, `create_time`, `update_time`, `is_delete`) VALUES (1, 0, 'v1.0', 10, '第一版', 'https://image.cws930.xyz/CellPhonesAccessories', '2021-11-29 06:23:55', 1, '2002-09-22 03:30:16', '2012-02-19 23:01:12', 0);
INSERT INTO `t_app_version` (`id`, `os`, `version`, `version_seq`, `version_desc`, `download_url`, `online_time`, `forced_update`, `create_time`, `update_time`, `is_delete`) VALUES (2, 1, 'v1.0', 10, '第一版', NULL, '2021-11-29 06:23:55', 1, '2000-02-10 11:00:00', '2005-04-10 07:17:10', 0);
INSERT INTO `t_app_version` (`id`, `os`, `version`, `version_seq`, `version_desc`, `download_url`, `online_time`, `forced_update`, `create_time`, `update_time`, `is_delete`) VALUES (3, 0, 'v1.1', 11, '修复bug', 'http://www.nakayamayu.org/BaggageTravelEquipment', '2021-12-01 06:23:55', 0, '2014-01-31 21:57:05', '2019-02-04 11:31:43', 0);
INSERT INTO `t_app_version` (`id`, `os`, `version`, `version_seq`, `version_desc`, `download_url`, `online_time`, `forced_update`, `create_time`, `update_time`, `is_delete`) VALUES (4, 1, 'v1.1', 11, '修复bug', NULL, '2021-12-01 06:23:55', 0, '2001-09-04 05:11:07', '2008-03-24 22:14:32', 0);
INSERT INTO `t_app_version` (`id`, `os`, `version`, `version_seq`, `version_desc`, `download_url`, `online_time`, `forced_update`, `create_time`, `update_time`, `is_delete`) VALUES (5, 0, 'v2.0', 20, '新增功能', 'http://video.hiutunglai.co.jp/Appliances', '2022-01-01 06:23:55', 0, '2017-05-16 09:08:48', '2015-03-04 20:08:40', 0);
INSERT INTO `t_app_version` (`id`, `os`, `version`, `version_seq`, `version_desc`, `download_url`, `online_time`, `forced_update`, `create_time`, `update_time`, `is_delete`) VALUES (6, 1, 'v2.0', 20, '新增功能', NULL, '2022-01-01 06:23:55', 0, '2017-05-16 09:08:48', '2015-03-04 20:08:40', 0);
SELECT
*
FROM
t_app_version
WHERE
is_delete = 0
AND online_time > now()
AND version_seq > $ { version_seq };