Commit f1bafc93 authored by ganjingcun's avatar ganjingcun

bug fug

parent 727dd9e4
FROM node:7.2.1
RUN mkdir -p /usr/src/app
RUN apt-get update
RUN apt-get install vim -y
HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD curl -fs http://localhost:3000/ || exit 1
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
......
......@@ -2070,8 +2070,11 @@ router.get('/firstwin', function (req, res) {
});
},
function (activity, callback) {
var sql2 = `select count(*) from battle_history where type ='athletic' and isfirstwin='t' and ( usernameA = '${username}' OR usernameB = '${username}' ) and start_time > '${activity.start}' and start_time < '${activity.end}'`
var sql2 = `select count(*) from battle_history where type ='athletic' and isfirstwin='t' and ( (usernameA = '${username}' AND userscorea > userscoreb ) OR (usernameB = '${username}' AND userscoreb > userscorea) ) and start_time > '${activity.start}' and start_time < '${activity.end}' `
console.log(sql2)
client.query(sql2, function (err, result) {
done()
......@@ -2083,7 +2086,7 @@ router.get('/firstwin', function (req, res) {
function (activity, callback) {
var today = moment().format('YYYY-MM-DD')
var sql2 = `select count(*) from battle_history where type ='athletic' and isfirstwin='t' and ( usernameA = '${username}' OR usernameB = '${username}' ) and start_time > '${today}' `
var sql2 = `select count(*) from battle_history where type ='athletic' and isfirstwin='t' and ( (usernameA = '${username}' AND userscorea > userscoreb ) OR (usernameB = '${username}' AND userscoreb > userscorea) ) and start_time > '${today}' `
console.log(sql2)
client.query(sql2, function (err, result) {
done()
......
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