Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-group
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
hujiebin
hilo-group
Commits
09d28573
Commit
09d28573
authored
Mar 14, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补上家族之星三个榜一
parent
fa68f2de
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
6 deletions
+49
-6
groupPower.go
cv/group_power_cv/groupPower.go
+5
-5
group_star.go
domain/model/groupPower_m/group_star.go
+21
-0
group_power.go
route/group_power_r/group_power.go
+23
-1
No files found.
cv/group_power_cv/groupPower.go
View file @
09d28573
...
@@ -653,7 +653,7 @@ func GetAllPowerDiamond(period string) (map[string]string, error) {
...
@@ -653,7 +653,7 @@ func GetAllPowerDiamond(period string) (map[string]string, error) {
type
GroupPowerInfo
struct
{
type
GroupPowerInfo
struct
{
Info
*
GroupPower
`json:"info"`
Info
*
GroupPower
`json:"info"`
Members
[]
*
GroupPowerUser
`json:"members"`
Members
[]
*
GroupPowerUser
`json:"members"`
Stars
[]
*
GroupPowerStar
t
`json:"stars
"`
Stars
[]
*
GroupPowerStar
`json:"stars,omitempty
"`
}
}
type
GroupPower
struct
{
type
GroupPower
struct
{
...
@@ -676,8 +676,8 @@ type GroupPowerUser struct {
...
@@ -676,8 +676,8 @@ type GroupPowerUser struct {
Role
groupPower_e
.
GroupPowerUserRole
`json:"role"`
Role
groupPower_e
.
GroupPowerUserRole
`json:"role"`
}
}
type
GroupPowerStar
t
struct
{
type
GroupPowerStar
struct
{
User
*
user_m
.
UserTiny
`json:"user"`
User
user_cv
.
CvUserTiny
`json:"user"`
RankingType
groupPower_e
.
GroupPowerRankType
`json:"rankingType"`
RankingType
groupPower_e
.
GroupPowerRankType
`json:"rankingType"`
}
}
...
...
domain/model/groupPower_m/group_star.go
View file @
09d28573
...
@@ -66,3 +66,24 @@ func GetGroupPowerMonthStarRank(model *domain.Model, groupPowerId mysql.ID, _typ
...
@@ -66,3 +66,24 @@ func GetGroupPowerMonthStarRank(model *domain.Model, groupPowerId mysql.ID, _typ
}
}
return
res
,
nil
return
res
,
nil
}
}
// 获取家族之星三个排行榜的各自第一名
func
GetGroupPowerMonthStartTop1
(
model
*
domain
.
Model
,
groupPowerId
mysql
.
ID
)
([]
*
GroupPowerMonthStar
,
error
)
{
var
res
[]
*
GroupPowerMonthStar
r1
,
err
:=
GetGroupPowerMonthStarRank
(
model
,
groupPowerId
,
groupPower_e
.
GroupPowerStarTypeFamous
,
0
,
1
)
if
err
!=
nil
{
return
res
,
err
}
r2
,
err
:=
GetGroupPowerMonthStarRank
(
model
,
groupPowerId
,
groupPower_e
.
GroupPowerStarTypeActive
,
0
,
1
)
if
err
!=
nil
{
return
res
,
err
}
r3
,
err
:=
GetGroupPowerMonthStarRank
(
model
,
groupPowerId
,
groupPower_e
.
GroupPowerStarTypeCharm
,
0
,
1
)
if
err
!=
nil
{
return
res
,
err
}
res
=
append
(
res
,
r1
...
)
res
=
append
(
res
,
r2
...
)
res
=
append
(
res
,
r3
...
)
return
res
,
nil
}
route/group_power_r/group_power.go
View file @
09d28573
...
@@ -748,7 +748,29 @@ func GroupPowerInfo(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -748,7 +748,29 @@ func GroupPowerInfo(c *gin.Context) (*mycontext.MyContext, error) {
Grade
:
gpInfo
.
Grade
,
Exp
:
gpInfo
.
Exp
,
NextExp
:
gpInfo
.
NextExp
,
GradeName
:
gpInfo
.
GradeName
,
GradeMedal
:
gpInfo
.
GradeMedal
,
Grade
:
gpInfo
.
Grade
,
Exp
:
gpInfo
.
Exp
,
NextExp
:
gpInfo
.
NextExp
,
GradeName
:
gpInfo
.
GradeName
,
GradeMedal
:
gpInfo
.
GradeMedal
,
MemberNum
:
mysql
.
Num
(
total
),
MemberMax
:
mysql
.
Num
(
group_power_cv
.
GroupPowerGradePrivilegeNum
[
groupPowerGrade
[
gp
.
ID
]
.
Grade
][
0
]
.
Num
),
MemberNum
:
mysql
.
Num
(
total
),
MemberMax
:
mysql
.
Num
(
group_power_cv
.
GroupPowerGradePrivilegeNum
[
groupPowerGrade
[
gp
.
ID
]
.
Grade
][
0
]
.
Num
),
}
}
res
:=
group_power_cv
.
GroupPowerInfo
{
Info
:
info
,
Members
:
resMembers
}
// 补上家族之星三个榜一
stars
,
err
:=
groupPower_m
.
GetGroupPowerMonthStartTop1
(
model
,
gp
.
ID
)
if
err
!=
nil
{
return
myContext
,
myerr
.
WrapErr
(
err
)
}
var
cvStar
[]
*
group_power_cv
.
GroupPowerStar
if
len
(
stars
)
>
0
{
var
userIds
[]
uint64
for
_
,
star
:=
range
stars
{
userIds
=
append
(
userIds
,
star
.
UserId
)
}
userM
,
err
:=
user_cv
.
GetUserTinyMap
(
userIds
)
if
err
!=
nil
{
return
myContext
,
err
}
for
_
,
star
:=
range
stars
{
cvStar
=
append
(
cvStar
,
&
group_power_cv
.
GroupPowerStar
{
User
:
userM
[
star
.
UserId
],
RankingType
:
groupPower_e
.
GroupPowerRankType
(
star
.
Type
),
})
}
}
res
:=
group_power_cv
.
GroupPowerInfo
{
Info
:
info
,
Members
:
resMembers
,
Stars
:
cvStar
}
resp
.
ResponseOk
(
c
,
res
)
resp
.
ResponseOk
(
c
,
res
)
return
myContext
,
nil
return
myContext
,
nil
...
...
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