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
363408c8
Commit
363408c8
authored
Mar 09, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:调整升级逻辑
parent
623b6af8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
19 deletions
+17
-19
grade.go
_const/enum/groupPower_e/grade.go
+7
-8
group_rank.go
cv/group_power_cv/group_rank.go
+8
-9
group_grade.go
domain/model/groupPower_m/group_grade.go
+2
-2
No files found.
_const/enum/groupPower_e/grade.go
View file @
363408c8
...
...
@@ -5,21 +5,20 @@ import "git.hilo.cn/hilo-common/resource/mysql"
type
GroupPowerGrade
int
const
(
GroupPowerGrade0
GroupPowerGrade
=
0
GroupPowerGrade1
GroupPowerGrade
=
1
// 青铜
GroupPowerGrade2
GroupPowerGrade
=
2
// 白银
GroupPowerGrade3
GroupPowerGrade
=
3
// 黄金
GroupPowerGrade4
GroupPowerGrade
=
4
// 黑金
GroupPowerGrade0
GroupPowerGrade
=
0
// 青铜
GroupPowerGrade1
GroupPowerGrade
=
1
// 白银
GroupPowerGrade2
GroupPowerGrade
=
2
// 黄金
GroupPowerGrade3
GroupPowerGrade
=
3
// 黑金
GroupPowerGradeMax
=
GroupPowerGrade
4
GroupPowerGradeMax
=
GroupPowerGrade
3
)
var
(
GroupPowerGradeExp
=
map
[
GroupPowerGrade
]
mysql
.
Num
{
GroupPowerGrade0
:
0
,
GroupPowerGrade1
:
2500000
,
GroupPowerGrade2
:
15000000
,
GroupPowerGrade3
:
45000000
,
// todo
GroupPowerGrade4
:
60000000
,
GroupPowerGrade3
:
60000000
,
}
)
...
...
cv/group_power_cv/group_rank.go
View file @
363408c8
...
...
@@ -63,28 +63,27 @@ type CvGroupPowerGradeDetail struct {
}
var
CvResGradeList
=
[]
CvResGrade
{
{
groupPower_e
.
GroupPowerGrade
1
,
"青铜icon"
,
"青铜bigIcon"
},
// todo
{
groupPower_e
.
GroupPowerGrade
2
,
"白银icon"
,
"白银bigIcon"
},
// todo
{
groupPower_e
.
GroupPowerGrade
3
,
"黄金icon"
,
"黄金bigIcon"
},
// todo
{
groupPower_e
.
GroupPowerGrade
4
,
"黑金icon"
,
"黑金bigIcon"
},
// todo
{
groupPower_e
.
GroupPowerGrade
0
,
"青铜icon"
,
"青铜bigIcon"
},
// todo
{
groupPower_e
.
GroupPowerGrade
1
,
"白银icon"
,
"白银bigIcon"
},
// todo
{
groupPower_e
.
GroupPowerGrade
2
,
"黄金icon"
,
"黄金bigIcon"
},
// todo
{
groupPower_e
.
GroupPowerGrade
3
,
"黑金icon"
,
"黑金bigIcon"
},
// todo
}
var
GroupPowerGradePrivilegeNum
=
map
[
groupPower_e
.
GroupPowerGrade
][]
CvPrivilege
{
groupPower_e
.
GroupPowerGrade0
:
{},
groupPower_e
.
GroupPowerGrade1
:
{
groupPower_e
.
GroupPowerGrade0
:
{
{
groupPower_e
.
GroupPowerPrivilegeMemberNum
,
300
},
{
groupPower_e
.
GroupPowerPrivilegeMgrNum
,
10
},
{
groupPower_e
.
GroupPowerPrivilegeNameplate
,
1
},
{
groupPower_e
.
GroupPowerPrivilegeMedal
,
1
},
},
groupPower_e
.
GroupPowerGrade
2
:
{
groupPower_e
.
GroupPowerGrade
1
:
{
{
groupPower_e
.
GroupPowerPrivilegeMemberNum
,
500
},
{
groupPower_e
.
GroupPowerPrivilegeMgrNum
,
15
},
{
groupPower_e
.
GroupPowerPrivilegeNameplate
,
1
},
{
groupPower_e
.
GroupPowerPrivilegeMedal
,
1
},
{
groupPower_e
.
GroupPowerPrivilegeNameplateEdit
,
1
},
},
groupPower_e
.
GroupPowerGrade
3
:
{
groupPower_e
.
GroupPowerGrade
2
:
{
{
groupPower_e
.
GroupPowerPrivilegeMemberNum
,
800
},
{
groupPower_e
.
GroupPowerPrivilegeMgrNum
,
20
},
{
groupPower_e
.
GroupPowerPrivilegeNameplate
,
1
},
...
...
@@ -92,7 +91,7 @@ var GroupPowerGradePrivilegeNum = map[groupPower_e.GroupPowerGrade][]CvPrivilege
{
groupPower_e
.
GroupPowerPrivilegeNameplateEdit
,
1
},
{
groupPower_e
.
GroupPowerPrivilegeNameplateHeadwear
,
1
},
},
groupPower_e
.
GroupPowerGrade
4
:
{
groupPower_e
.
GroupPowerGrade
3
:
{
{
groupPower_e
.
GroupPowerPrivilegeMemberNum
,
1200
},
{
groupPower_e
.
GroupPowerPrivilegeMgrNum
,
25
},
{
groupPower_e
.
GroupPowerPrivilegeNameplate
,
1
},
...
...
domain/model/groupPower_m/group_grade.go
View file @
363408c8
...
...
@@ -112,8 +112,8 @@ func IncrGroupPowerExp(txModel *domain.Model, groupPowerId mysql.ID, exp mysql.N
}
// 达到经验值之后升级
for
grade
:=
groupPower_e
.
GroupPowerGradeMax
;
grade
>=
groupPower_e
.
GroupPowerGrade0
;
grade
--
{
if
latestGrade
.
Exp
>
mysql
.
Num
(
groupPower_e
.
GroupPowerGradeExp
[
grade
])
{
if
latestGrade
.
Grade
<
grade
{
//
积分清零后,等级保持一段时间
if
latestGrade
.
Exp
>
groupPower_e
.
GroupPowerGradeExp
[
grade
]
{
if
latestGrade
.
Grade
<
grade
{
//
升级
expireAt
:=
now
.
EndOfMonth
()
expireAt
=
utils
.
AddDate
(
expireAt
,
0
,
1
)
// 等级有效期到下个月月底
updateAttrs
:=
map
[
string
]
interface
{}{
...
...
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