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
14ee16af
Commit
14ee16af
authored
May 30, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
99+
parent
71871c7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
rank.go
cv/cp_cv/rank.go
+1
-1
rank.go
route/cp_r/rank.go
+8
-6
No files found.
cv/cp_cv/rank.go
View file @
14ee16af
...
...
@@ -11,7 +11,7 @@ type CvCp struct {
User2
*
user_cv
.
CvUserBase
`json:"user2"`
// user2
Score
uint32
`json:"score"`
// 分值
CpLevel
CvCpLevel
`json:"cpLevel"`
// cp等级
//Ranking int
`json:"ranking"` // 排名
Ranking
string
`json:"ranking"`
// 排名
}
type
CvCpAchievement
struct
{
...
...
route/cp_r/rank.go
View file @
14ee16af
package
cp_r
import
(
"fmt"
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/mycontext"
"git.hilo.cn/hilo-common/resource/mysql"
...
...
@@ -70,13 +71,13 @@ func CpRank(c *gin.Context) (*mycontext.MyContext, error) {
return
myCtx
,
err
}
cpLevels
:=
cp_m
.
MGetCpLevel
(
model
,
cpIds
)
for
_
,
rank
:=
range
ranks
{
for
i
,
rank
:=
range
ranks
{
response
=
append
(
response
,
cp_cv
.
CvCp
{
CpId
:
rank
.
CpId
,
User1
:
userBase
[
rank
.
UserId1
],
User2
:
userBase
[
rank
.
UserId2
],
Score
:
rank
.
Score
,
//Ranking: i + 1 + offset
,
CpId
:
rank
.
CpId
,
User1
:
userBase
[
rank
.
UserId1
],
User2
:
userBase
[
rank
.
UserId2
],
Score
:
rank
.
Score
,
Ranking
:
fmt
.
Sprintf
(
"%d"
,
i
+
1
+
offset
)
,
CpLevel
:
cp_cv
.
CvCpLevel
{
Level
:
cpLevels
[
rank
.
CpId
]
.
Level
,
//Points: cp_e.CpLevelPoints[cpLevel] + curPoints,
...
...
@@ -149,6 +150,7 @@ func CpMy(c *gin.Context) (*mycontext.MyContext, error) {
}
if
relation
.
UserId2
>
0
{
response
.
User2
=
userBases
[
relation
.
UserId2
]
response
.
Ranking
=
"99+"
}
resp
.
ResponseOk
(
c
,
response
)
return
myCtx
,
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