1
This commit is contained in:
parent
8c912dd185
commit
7aa8729bbe
@ -26,13 +26,28 @@ class Fragment {
|
|||||||
const hourSeconds = utils.getHourSeconds(nowTime, constant.TIME_ZONE);
|
const hourSeconds = utils.getHourSeconds(nowTime, constant.TIME_ZONE);
|
||||||
const {err, conn} = await app.getDbConn("GameDb1");
|
const {err, conn} = await app.getDbConn("GameDb1");
|
||||||
if (!err && conn) {
|
if (!err && conn) {
|
||||||
const {err, rows} = await conn.execQuery();
|
const allocedFragments = await this.fetchAllocedFragments(conn);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fetchAllocedFragments(conn) {
|
||||||
|
const {err, rows} = await conn.execQuery(
|
||||||
|
'SELECT * FROM t_fragment_pool WHERE alloc_time >= ? AND alloc_time <= ?',
|
||||||
|
[
|
||||||
|
|
||||||
|
]
|
||||||
|
);
|
||||||
|
if (err) {
|
||||||
|
throw err;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const allocedFragments = {};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
@ -610,6 +610,7 @@ DROP TABLE IF EXISTS `t_fragment_pool`;
|
|||||||
CREATE TABLE `t_fragment_pool` (
|
CREATE TABLE `t_fragment_pool` (
|
||||||
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||||
`fragment_id` int(11) NOT NULL DEFAULT '0' COMMENT '碎片id',
|
`fragment_id` int(11) NOT NULL DEFAULT '0' COMMENT '碎片id',
|
||||||
|
`type` int(11) NOT NULL DEFAULT '0' COMMENT '0:pvp 1:pve',
|
||||||
`fragment_type` int(11) NOT NULL DEFAULT '0' COMMENT '碎片类型 0:英雄 1:武器',
|
`fragment_type` int(11) NOT NULL DEFAULT '0' COMMENT '碎片类型 0:英雄 1:武器',
|
||||||
`fragment_num` int(11) NOT NULL DEFAULT '0' COMMENT '剩余碎片数量',
|
`fragment_num` int(11) NOT NULL DEFAULT '0' COMMENT '剩余碎片数量',
|
||||||
`alloc_num` int(11) NOT NULL DEFAULT '0' COMMENT '分配的碎片数量',
|
`alloc_num` int(11) NOT NULL DEFAULT '0' COMMENT '分配的碎片数量',
|
||||||
@ -617,7 +618,7 @@ CREATE TABLE `t_fragment_pool` (
|
|||||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||||
PRIMARY KEY (`idx`),
|
PRIMARY KEY (`idx`),
|
||||||
KEY `alloc_time_fragment_type` (`alloc_time`, `fragment_type`)
|
KEY `alloc_time_type_fragment_type` (`alloc_time`, `type`, `fragment_type`)
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user