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
2fcefb22
Commit
2fcefb22
authored
Jun 16, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:优化ggroupId
parent
8f567d6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
11 deletions
+3
-11
level.go
domain/model/cp_m/level.go
+2
-10
cp_level.go
domain/service/event_s/cp_level.go
+1
-1
No files found.
domain/model/cp_m/level.go
View file @
2fcefb22
...
...
@@ -137,7 +137,7 @@ func InitCpLevel(model *domain.Model, cpId, userId1, userId2 mysql.ID) error {
// 2.记录存在
// 2.1 在有效期内,直接加points后判断新level,升级需要更新有效期
// 2.2 不有效期内,算首充,重置points后判断新level,升级需要更新有效期
func
AddCpLevelPoints
(
model
*
domain
.
Model
,
cpRelation
CpRelation
,
points
mysql
.
Num
,
sceneType
gift_e
.
GiftOperateSceneType
)
(
err
error
)
{
func
AddCpLevelPoints
(
model
*
domain
.
Model
,
cpRelation
CpRelation
,
points
mysql
.
Num
,
sceneType
gift_e
.
GiftOperateSceneType
,
sceneUid
string
)
(
err
error
)
{
start
:=
time
.
Now
()
defer
func
()
{
model
.
Log
.
Infof
(
"AddCpLevelPoints cost:%v,err:%v"
,
time
.
Now
()
.
Sub
(
start
),
err
)
...
...
@@ -294,15 +294,7 @@ func AddCpLevelPoints(model *domain.Model, cpRelation CpRelation, points mysql.N
model
.
Log
.
Errorf
(
""
)
return
}
levelMsgIdMap
:=
map
[
cp_e
.
CpLevel
]
uint
{
cp_e
.
CpLevel1
:
252
,
cp_e
.
CpLevel2
:
253
,
cp_e
.
CpLevel3
:
254
,
cp_e
.
CpLevel4
:
255
,
cp_e
.
CpLevel5
:
256
,
}
content
:=
fmt
.
Sprintf
(
GetTranslate
(
286
,
users
[
userId1
]
.
Language
),
GetTranslate
(
levelMsgIdMap
[
cpLevel
.
Level
],
users
[
userId1
]
.
Language
))
if
err
:=
rpc
.
SendCpUpgrade
(
users
[
userId1
]
.
Nick
,
users
[
userId2
]
.
Nick
,
users
[
userId1
]
.
Avatar
,
users
[
userId2
]
.
Avatar
,
uint32
(
cpLevel
.
Level
),
content
);
err
!=
nil
{
if
err
:=
rpc
.
SendCpUpgrade
(
users
[
userId1
]
.
Nick
,
users
[
userId2
]
.
Nick
,
users
[
userId1
]
.
Avatar
,
users
[
userId2
]
.
Avatar
,
uint32
(
cpLevel
.
Level
),
sceneUid
);
err
!=
nil
{
model
.
Log
.
Errorf
(
"SendCpUpgrade fail:%v"
,
err
)
}
}()
...
...
domain/service/event_s/cp_level.go
View file @
2fcefb22
...
...
@@ -26,7 +26,7 @@ func CpGiftEvent() {
diamonds
:=
sendGiftEvent
.
GiftN
*
sendGiftEvent
.
ResGift
.
DiamondNum
// 有cp关系
if
cpRelation
,
exits
:=
cp_m
.
GetCpRelationPair
(
model
,
sendGiftEvent
.
SendUserId
,
receiverUid
);
exits
{
if
err
:=
cp_m
.
AddCpLevelPoints
(
model
,
cpRelation
,
diamonds
,
sendGiftEvent
.
SceneType
);
err
!=
nil
{
if
err
:=
cp_m
.
AddCpLevelPoints
(
model
,
cpRelation
,
diamonds
,
sendGiftEvent
.
SceneType
,
sendGiftEvent
.
SceneUid
);
err
!=
nil
{
model
.
Log
.
Errorf
(
"AddCpLevelPoints fail:%v"
,
err
)
}
if
err
:=
cp_m
.
AddCpDayRank
(
model
,
cpRelation
,
diamonds
);
err
!=
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