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
ff26e264
Commit
ff26e264
authored
Jun 22, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cp补偿分数
parent
49350b91
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
cp_level.go
domain/service/event_s/cp_level.go
+10
-3
event_init.go
domain/service/event_s/event_init.go
+1
-0
No files found.
domain/service/event_s/cp_level.go
View file @
ff26e264
...
...
@@ -2,6 +2,7 @@ package event_s
import
(
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/resource/config"
"git.hilo.cn/hilo-common/resource/redisCli"
"github.com/jinzhu/now"
"hilo-user/_const/enum/cp_e"
...
...
@@ -76,8 +77,11 @@ func CpGiftEvent() {
// 送礼增加cp等级
// 送礼增加cp排行榜
func
CompensateCpScore
()
{
if
!
config
.
IsMaster
()
{
return
}
model
:=
domain
.
CreateModelNil
()
num
,
err
:=
redisCli
.
IncrNumExpire
(
"scirpt:
C
ompensateCpScore"
,
1
,
time
.
Hour
*
999
)
num
,
err
:=
redisCli
.
IncrNumExpire
(
"scirpt:
c
ompensateCpScore"
,
1
,
time
.
Hour
*
999
)
if
err
!=
nil
{
model
.
Log
.
Errorf
(
"CompensateCpScore err:%v"
,
err
)
}
...
...
@@ -98,8 +102,11 @@ func CompensateCpScore() {
CreatedTime
time
.
Time
`json:"created_time"`
}
rows
:=
make
([]
*
GiftOperate
,
0
)
err
=
model
.
DB
()
.
Model
(
GiftOperate
{})
.
Where
(
"res_gift_id in (?)"
,
[]
int
{
3561
,
3571
,
3581
,
3591
,
3601
,
3611
,
3621
,
3631
,
3641
,
3651
,
3661
,
3671
,
3681
,
3691
,
3701
,
3711
})
.
Where
(
"created_time < ?"
,
"2023-06-22 11:20:15"
)
.
Find
(
&
rows
)
.
Error
err
=
model
.
DB
()
.
Model
(
GiftOperate
{})
.
Where
(
"created_time < ?"
,
"2023-06-22 11:20:15"
)
.
Where
(
"res_gift_id in (?)"
,
[]
int
{
3561
,
3571
,
3581
,
3591
,
3601
,
3611
,
3621
,
3631
,
3641
,
3651
,
3661
,
3671
,
3681
,
3691
,
3701
,
3711
})
.
Find
(
&
rows
)
.
Error
if
err
!=
nil
{
model
.
Log
.
Errorf
(
"CompensateCpScore err:%v"
,
err
)
return
...
...
domain/service/event_s/event_init.go
View file @
ff26e264
...
...
@@ -16,6 +16,7 @@ func EventInit() {
UserBagSendEvent
()
CpGiftEvent
()
CpSpaceVisitEvent
()
CompensateCpScore
()
}
func
UserBagSendEvent
()
{
...
...
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