Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-user
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
chenweijian
hilo-user
Commits
d1591ff1
Commit
d1591ff1
authored
Jun 16, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cpLvel
parent
934c9fe0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
rank.go
cv/cp_cv/rank.go
+1
-0
rank.go
route/cp_r/rank.go
+4
-0
No files found.
cv/cp_cv/rank.go
View file @
d1591ff1
...
@@ -18,6 +18,7 @@ type CvCpAchievement struct {
...
@@ -18,6 +18,7 @@ type CvCpAchievement struct {
CpId
uint64
`json:"cpId"`
// cpId
CpId
uint64
`json:"cpId"`
// cpId
User1
*
user_cv
.
UserTiny
`json:"user1"`
// user1
User1
*
user_cv
.
UserTiny
`json:"user1"`
// user1
User2
*
user_cv
.
UserTiny
`json:"user2"`
// user2
User2
*
user_cv
.
UserTiny
`json:"user2"`
// user2
CpLevel
cp_e
.
CpLevel
`json:"cpLevel"`
// cpLevel
Type
cp_e
.
CpAchievement
`json:"type"`
// 成就类型 1:等级 2:空间访问人数 3:月榜最高 4:周榜最高 5:日榜最高
Type
cp_e
.
CpAchievement
`json:"type"`
// 成就类型 1:等级 2:空间访问人数 3:月榜最高 4:周榜最高 5:日榜最高
TypeDesc
string
`json:"typeDesc"`
// 成就类型翻译
TypeDesc
string
`json:"typeDesc"`
// 成就类型翻译
Score
uint32
`json:"score"`
// 分值
Score
uint32
`json:"score"`
// 分值
...
...
route/cp_r/rank.go
View file @
d1591ff1
...
@@ -259,19 +259,23 @@ func CpAchievement(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -259,19 +259,23 @@ func CpAchievement(c *gin.Context) (*mycontext.MyContext, error) {
}
}
achievements
:=
cp_m
.
GetCpAchievements
(
model
)
achievements
:=
cp_m
.
GetCpAchievements
(
model
)
var
userIds
[]
uint64
var
userIds
[]
uint64
var
cpIds
[]
uint64
for
_
,
v
:=
range
achievements
{
for
_
,
v
:=
range
achievements
{
userIds
=
append
(
userIds
,
v
.
UserId1
)
userIds
=
append
(
userIds
,
v
.
UserId1
)
userIds
=
append
(
userIds
,
v
.
UserId2
)
userIds
=
append
(
userIds
,
v
.
UserId2
)
cpIds
=
append
(
cpIds
,
v
.
CpId
)
}
}
users
,
err
:=
user_m
.
GetUserMapByIds
(
model
,
userIds
)
users
,
err
:=
user_m
.
GetUserMapByIds
(
model
,
userIds
)
if
err
!=
nil
{
if
err
!=
nil
{
return
myCtx
,
err
return
myCtx
,
err
}
}
cpLevels
:=
cp_m
.
MGetCpLevel
(
model
,
cpIds
)
for
_
,
a
:=
range
achievements
{
for
_
,
a
:=
range
achievements
{
response
=
append
(
response
,
cp_cv
.
CvCpAchievement
{
response
=
append
(
response
,
cp_cv
.
CvCpAchievement
{
CpId
:
a
.
CpId
,
CpId
:
a
.
CpId
,
User1
:
user_cv
.
UserToTiny
(
users
[
a
.
UserId1
]),
User1
:
user_cv
.
UserToTiny
(
users
[
a
.
UserId1
]),
User2
:
user_cv
.
UserToTiny
(
users
[
a
.
UserId2
]),
User2
:
user_cv
.
UserToTiny
(
users
[
a
.
UserId2
]),
CpLevel
:
cpLevels
[
a
.
CpId
]
.
Level
,
Type
:
a
.
Type
,
Type
:
a
.
Type
,
TypeDesc
:
cp_m
.
GetTranslate
(
TypeDescMap
[
a
.
Type
],
lang
),
TypeDesc
:
cp_m
.
GetTranslate
(
TypeDescMap
[
a
.
Type
],
lang
),
Score
:
a
.
Score
,
Score
:
a
.
Score
,
...
...
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