Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Dealer Counter
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
Dealer Counter
Commits
652f755a
Commit
652f755a
authored
Feb 15, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
env
parent
67ee7b63
Pipeline
#25432
passed with stages
in 4 minutes and 8 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
3 deletions
+30
-3
src/app.service.ts
src/app.service.ts
+30
-3
No files found.
src/app.service.ts
View file @
652f755a
...
@@ -37,6 +37,35 @@ export class AppService extends ConsoleLogger {
...
@@ -37,6 +37,35 @@ export class AppService extends ConsoleLogger {
return
new
GenericReturnMessageDto
(
200
,
'
success
'
,
dto
);
return
new
GenericReturnMessageDto
(
200
,
'
success
'
,
dto
);
}
}
async
getMatchResultInv
(
username
:
string
)
{
const
[
win
,
total
]
=
await
Promise
.
all
([
this
.
duelLogPlayerRepository
.
createQueryBuilder
(
'
duelLogPlayer
'
)
.
innerJoin
(
'
duelLogPlayer.duelLog
'
,
'
duelLog
'
)
.
innerJoin
(
'
duelLog.players
'
,
'
dealer
'
,
'
dealer.realName IN (:...dealerUsernames) and dealer.winner = 0
'
,
{
dealerUsernames
:
this
.
dealerUsername
,
},
)
.
where
(
'
duelLogPlayer.realName = :username
'
,
{
username
})
.
select
(
'
COUNT(duelLogPlayer.id)
'
,
'
win
'
)
.
getRawOne
<
{
win
:
string
}
>
(),
this
.
duelLogPlayerRepository
.
count
({
where
:
{
realName
:
username
,
},
}),
]);
const
dto
=
new
MatchResultDto
();
dto
.
win
=
parseInt
(
win
.
win
)
||
0
;
dto
.
total
=
total
||
0
;
dto
.
lose
=
dto
.
total
-
dto
.
win
;
return
new
GenericReturnMessageDto
(
200
,
'
success
'
,
dto
);
}
async
getDealerMatchResult
()
{
async
getDealerMatchResult
()
{
return
await
this
.
getMatchResult
({
return
await
this
.
getMatchResult
({
realName
:
In
(
this
.
dealerUsername
),
realName
:
In
(
this
.
dealerUsername
),
...
@@ -44,8 +73,6 @@ export class AppService extends ConsoleLogger {
...
@@ -44,8 +73,6 @@ export class AppService extends ConsoleLogger {
}
}
async
getUserMatchResult
(
username
:
string
)
{
async
getUserMatchResult
(
username
:
string
)
{
return
await
this
.
getMatchResult
({
return
await
this
.
getMatchResultInv
(
username
);
realName
:
username
,
});
}
}
}
}
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