Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nbya
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoyanbin
nbya
Commits
915646b7
Commit
915646b7
authored
Jan 27, 2022
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d40ef1a2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
9 deletions
+15
-9
org_player.go
app/mobile/apis/org_player.go
+6
-5
org_player.go
app/mobile/router/org_player.go
+1
-1
org_player.go
app/mobile/service/org_player.go
+8
-3
No files found.
app/mobile/apis/org_player.go
View file @
915646b7
...
...
@@ -201,14 +201,14 @@ func (e OrgPlayer) GetInfo(c *gin.Context) {
// @Tags <手机端>球员数据
// @Param playerId path string false "playerId"
// @Success 200 {string} string "{"code": 200, "data": [...]}"
// @Router /mobile/v1/org-player/get-match-season
/{id}
[get]
// @Router /mobile/v1/org-player/get-match-season [get]
// @Security Bearer
func
(
e
OrgPlayer
)
GetOrgMatchSeason
(
c
*
gin
.
Context
)
{
req
:=
dto
.
OrgPlayerGetReq
{}
req
:=
dto
.
OrgPlayerGet
Info
Req
{}
s
:=
service
.
OrgPlayer
{}
c
.
Bind
(
&
req
)
err
:=
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
Bind
(
&
req
)
.
MakeService
(
&
s
.
Service
)
.
Errors
if
err
!=
nil
{
...
...
@@ -220,12 +220,13 @@ func (e OrgPlayer) GetOrgMatchSeason(c *gin.Context) {
err
,
matchId2
:=
s
.
GetMatchId
(
strconv
.
Itoa
(
req
.
PlayerId
),
""
)
replyGetRoundsScoring
:=
make
([]
dto
.
OrgPlayerRoundsScoring
,
0
)
err
=
s
.
GetSeasonRoundsScoring
(
strconv
.
Itoa
(
req
.
PlayerId
),
matchId2
,
&
replyGetRoundsScoring
)
var
count
int64
err
=
s
.
GetSeasonRoundsScoring
(
&
req
,
matchId2
,
&
replyGetRoundsScoring
,
&
count
)
if
err
!=
nil
{
e
.
Error
(
500
,
err
,
fmt
.
Sprintf
(
"获取比赛球员信息 失败,
\r\n
失败信息 %s"
,
err
.
Error
()))
return
}
e
.
OK
(
replyGetRoundsScoring
,
"查询成功"
)
e
.
PageOK
(
replyGetRoundsScoring
,
int
(
count
),
req
.
GetPageIndex
(),
req
.
GetPageSize
()
,
"查询成功"
)
}
// Get <手机端>获取球员精彩时刻
...
...
app/mobile/router/org_player.go
View file @
915646b7
...
...
@@ -17,7 +17,7 @@ func registerOrgPlayerRouter(v1 *gin.RouterGroup) {
r
.
GET
(
""
,
api
.
GetPage
)
r
.
GET
(
"/:id"
,
api
.
Get
)
r
.
GET
(
"/info"
,
api
.
GetInfo
)
r
.
GET
(
"/get-match-season
/:id
"
,
api
.
GetOrgMatchSeason
)
r
.
GET
(
"/get-match-season"
,
api
.
GetOrgMatchSeason
)
r
.
GET
(
"/evaluate"
,
api
.
GetOrgMatchEvaluate
)
r
.
GET
(
"/evaluate-content"
,
api
.
GetOrgMatchEvaluateContent
)
r
.
GET
(
"/get-rounds"
,
api
.
GetOrgRounds
)
...
...
app/mobile/service/org_player.go
View file @
915646b7
...
...
@@ -273,7 +273,7 @@ func (e *OrgPlayer) GetRoundsScoring(c *dto.OrgPlayerGetInfoReq, matchId []strin
return
nil
}
func
(
e
*
OrgPlayer
)
GetSeasonRoundsScoring
(
playerId
string
,
matchId
[]
string
,
data
*
[]
dto
.
OrgPlayerRoundsScoring
)
error
{
func
(
e
*
OrgPlayer
)
GetSeasonRoundsScoring
(
c
*
dto
.
OrgPlayerGetInfoReq
,
matchId
[]
string
,
data
*
[]
dto
.
OrgPlayerRoundsScoring
,
count
*
int64
)
error
{
var
err
error
field
:=
"om.season_id as id, omtp.team_id, ot.team_name, ol.league_name, os.season_name, count(omtp.id)as count_match,"
+
...
...
@@ -293,10 +293,15 @@ func (e *OrgPlayer) GetSeasonRoundsScoring(playerId string, matchId []string, da
Joins
(
"left join org_team as ot on omtp.team_id = ot.id"
)
.
Joins
(
"left join org_league as ol on om.league_id = ol.id"
)
.
Joins
(
"left join org_season as os on om.season_id = os.id"
)
.
Scopes
(
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
cDto
.
PassDel
(
"om"
),
)
.
Where
(
"omtp.match_id in (?)"
,
matchId
)
.
Where
(
"omtp.player_id = ? "
,
p
layerId
)
.
Where
(
"omtp.player_id = ? "
,
c
.
P
layerId
)
.
Group
(
"om.season_id"
)
.
Find
(
data
)
.
Error
Find
(
data
)
.
Count
(
count
)
.
Error
if
err
!=
nil
{
e
.
Log
.
Errorf
(
"OrgMatchService GetRoundsScoring error:%s
\r\n
"
,
err
)
return
err
...
...
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