router.get('/test', function(req, res, next) {
sqlQuery("select * from userinfo", (data) => {
let type2num = {}
data.forEach(({ id, type, num }) => {
if (type2num[type])
type2num[type] += num
else
type2num[type] = num
})
res.send({
code: "200",
message: "查询成功",
data,
type2num,
});
});
});