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
afe61fba
Commit
afe61fba
authored
Jan 29, 2022
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Club
parent
8661130f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
org_player.go
app/operate/apis/org_player.go
+8
-0
org_player.go
app/operate/service/dto/org_player.go
+1
-0
org_player.go
app/operate/service/org_player.go
+2
-1
No files found.
app/operate/apis/org_player.go
View file @
afe61fba
...
...
@@ -24,6 +24,13 @@ func (e OrgPlayer) getTeamId(c *gin.Context) string {
return
teamId
}
func
(
e
OrgPlayer
)
getClubId
(
c
*
gin
.
Context
)
string
{
sOrgTeamUser
:=
service
.
OrgClubUser
{}
e
.
MakeContext
(
c
)
.
MakeOrm
()
.
MakeService
(
&
sOrgTeamUser
.
Service
)
_
,
teamId
:=
sOrgTeamUser
.
GetClubId
(
user
.
GetUserId
(
c
))
return
teamId
}
// GetPage <球队>获取球员列表
// @Summary <球队>获取球员列表
// @Description <球队>获取球员列表
...
...
@@ -53,6 +60,7 @@ func (e OrgPlayer) GetPage(c *gin.Context) {
var
count
int64
req
.
TeamId
=
e
.
getTeamId
(
c
)
req
.
ClubId
=
e
.
getClubId
(
c
)
err
=
s
.
GetPage
(
&
req
,
p
,
&
list
,
&
count
)
if
err
!=
nil
{
...
...
app/operate/service/dto/org_player.go
View file @
afe61fba
...
...
@@ -11,6 +11,7 @@ import (
type
OrgPlayerGetPageReq
struct
{
dto
.
Pagination
`search:"-"`
ClubId
string
`form:"clubId" search:"-"`
TeamId
string
`form:"teamId" search:"-"`
TeamName
string
`form:"teamName" search:"type:contains;column:team_name;table:ot" comment:""`
PlayerName
string
`form:"playerName" search:"type:contains;column:player_name;table:op" comment:""`
...
...
app/operate/service/org_player.go
View file @
afe61fba
...
...
@@ -22,7 +22,7 @@ func (e *OrgPlayer) GetPage(c *dto.OrgPlayerGetPageReq, p *actions.DataPermissio
err
=
e
.
Orm
.
Table
(
"org_player as op"
)
.
Select
(
"op.id,op.club_id,oc.club_name,op.team_id,ot.team_name,"
+
"op.player_name,op.player_number,op.position,op.sex,op.status"
)
.
"op.player_name,op.player_n
ame_en,op.player_n
umber,op.position,op.sex,op.status"
)
.
Joins
(
"left join org_club as oc on op.club_id=oc.id"
)
.
Joins
(
"left join org_team as ot on op.team_id=ot.id"
)
.
Joins
(
"left join org_player_user as opu on op.player_user_id=opu.id"
)
.
...
...
@@ -31,6 +31,7 @@ func (e *OrgPlayer) GetPage(c *dto.OrgPlayerGetPageReq, p *actions.DataPermissio
cDto
.
Paginate
(
c
.
GetPageSize
(),
c
.
GetPageIndex
()),
actions
.
Permission
(
data
.
TableName
(),
p
),
cDto
.
SetWhere
(
"op"
,
"team_id"
,
c
.
TeamId
),
cDto
.
SetWhere
(
"op"
,
"club_id"
,
c
.
ClubId
),
cDto
.
PassDel
(
"op"
),
)
.
Find
(
list
)
.
Limit
(
-
1
)
.
Offset
(
-
1
)
.
...
...
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