Commit 2388d575 authored by ganjingcun's avatar ganjingcun

first win bug fixed

parent 9fa88ce1
......@@ -192,14 +192,14 @@ router.post('/score', function (req, res) {
paramB['athletic_draw'] = 1
}
var queryFirsrWinSql = `select count(*) from battle_history where ( (usernameA = '${winner}' AND userscorea > userscoreb ) OR (usernameB = '${winner}' AND userscoreb > userscorea) ) and start_time > date '${today}' `
var queryFirsrWinSql = `select count(*) from battle_history where type ='athletic' and ( (usernameA = '${winner}' AND userscorea > userscoreb ) OR (usernameB = '${winner}' AND userscoreb > userscorea) ) and start_time > date '${today}' `
client.query(queryFirsrWinSql, function (err, result) {
done()
var total = 0;
if (!err) {
total = result.rows[0].count - 0
if (total == 0) {
if (winner !== "none" && total == 0) {
firstWin = true
}
}
......@@ -208,7 +208,7 @@ router.post('/score', function (req, res) {
// 3分钟以内结束的决斗,胜者不加DP,负者照常扣DP。 平局不扣DP不加DP : 把开始时间+3分钟,如果加完比结束时间靠后,说明比赛时间不足三分钟
var isLess3Min = moment(start).add(3, 'm').isAfter(moment(end));
if(isLess3Min){
if (isLess3Min) {
if (winner === usernameA) {
ptResult.ptA = userA.pt
console.log(usernameA, '当局有人存在早退,胜利不加分', moment().format('YYYY-MM-DD HH:mm'))
......
......@@ -14,10 +14,10 @@ superagent
accesskey: "XnvGjNG8jttfjYWhtqtgRfWBtyEwjMaF",
usernameA: "Joe1991",
usernameB: "zh99998",
userscoreA: 2,
userscoreA: 1,
userscoreB: 1,
start: mement().format(),
end: mement().add(4,'m').format(),
end: mement().add(6,'m').format(),
arena: 'athletic' // 'athletic' 竞技 or 'entertain' 娱乐
})
.end(function (err, res) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment