Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-arena-api
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro-arena-api
Commits
975dd987
Commit
975dd987
authored
Dec 24, 2016
by
ganjingcun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s
parent
bcfe149a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
6 deletions
+15
-6
routes/api.js
routes/api.js
+15
-6
No files found.
routes/api.js
View file @
975dd987
...
...
@@ -182,7 +182,6 @@ router.post('/score', function (req, res) {
}).
pop
().
on
(
'
end
'
,
function
()
{
console
.
log
(
"
finished update score !
"
)
done
()
res
.
json
({
msg
:
'
success
'
})
})
})
...
...
@@ -207,8 +206,8 @@ router.post('/score', function (req, res) {
}
})
res
.
json
({
msg
:
'
success
'
})
})
})
router
.
get
(
'
/users
'
,
function
(
req
,
res
)
{
...
...
@@ -284,20 +283,30 @@ router.get('/user', function (req, res) {
return
res
.
status
(
404
).
send
(
`username
${
username
}
not found`
)
}
else
{
var
user
=
result
.
rows
[
0
]
resultData
[
'
exp
'
]
=
user
[
'
exp
'
]
resultData
[
'
pt
'
]
=
user
[
'
pt
'
]
resultData
[
'
exp
'
]
=
parseInt
(
user
[
'
exp
'
])
resultData
[
'
pt
'
]
=
parseInt
(
user
[
'
pt
'
])
resultData
[
'
entertain_win
'
]
=
user
[
'
entertain_win
'
]
resultData
[
'
entertain_lose
'
]
=
user
[
'
entertain_lose
'
]
resultData
[
'
entertain_draw
'
]
=
user
[
'
entertain_draw
'
]
resultData
[
'
entertain_all
'
]
=
user
[
'
entertain_all
'
]
resultData
[
'
entertain_wl_ratio
'
]
=
(
user
[
'
entertain_win
'
]
/
user
[
'
entertain_all
'
]
*
100
).
toFixed
(
2
)
entertain_wl_ratio
=
0
if
(
user
[
'
entertain_all
'
]
>
0
)
{
entertain_wl_ratio
=
(
user
[
'
entertain_win
'
]
/
user
[
'
entertain_all
'
]
*
100
).
toFixed
(
2
)
}
resultData
[
'
entertain_wl_ratio
'
]
=
entertain_wl_ratio
resultData
[
'
athletic_win
'
]
=
user
[
'
athletic_win
'
]
resultData
[
'
athletic_lose
'
]
=
user
[
'
athletic_lose
'
]
resultData
[
'
athletic_draw
'
]
=
user
[
'
athletic_draw
'
]
resultData
[
'
athletic_all
'
]
=
user
[
'
athletic_all
'
]
resultData
[
'
athletic_wl_ratio
'
]
=
(
user
[
'
athletic_win
'
]
/
user
[
'
athletic_all
'
]
*
100
).
toFixed
(
2
)
let
athletic_wl_ratio
=
0
if
(
user
[
'
athletic_all
'
]
>
0
)
{
athletic_wl_ratio
=
(
user
[
'
athletic_win
'
]
/
user
[
'
athletic_all
'
]
*
100
).
toFixed
(
2
)
}
resultData
[
'
athletic_wl_ratio
'
]
=
athletic_wl_ratio
var
ep
=
new
eventproxy
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment