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
739fe8b2
Commit
739fe8b2
authored
May 01, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
家族排行奖励bug
parent
8c06f31f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
group_power.go
domain/service/group_power_s/group_power.go
+5
-4
group_power_test.go
test/group_power_test.go
+1
-1
No files found.
domain/service/group_power_s/group_power.go
View file @
739fe8b2
...
...
@@ -16,11 +16,11 @@ import (
"hilo-group/domain/cache/user_c"
"hilo-group/domain/event/group_power_ev"
"hilo-group/domain/model/groupPower_m"
"time"
"hilo-group/domain/model/msg_m"
"hilo-group/domain/model/noble_m"
"hilo-group/domain/model/user_m"
"hilo-group/myerr/bizerr"
"time"
)
type
GroupPowerService
struct
{
...
...
@@ -193,11 +193,12 @@ func CalcGroupPowerMonthRankAct(model *domain.Model) error {
lastDayTime
:=
time
.
Now
()
.
AddDate
(
0
,
0
,
-
1
)
_now
:=
now
.
New
(
lastDayTime
)
calcMonth
:=
_now
.
BeginningOfMonth
()
.
Format
(
utils
.
MONTH_FORMAT
)
starDate
:=
_now
.
BeginningOfMonth
()
.
Format
(
utils
.
COMPACT_MONTH_FORMAT
)
beginDate
,
endDate
:=
_now
.
BeginningOfMonth
()
.
Format
(
"2006-01-02"
),
_now
.
EndOfMonth
()
.
Format
(
"2006-01-02"
)
return
DoCalcGroupPowerMonthRankAct
(
model
,
calcMonth
,
beginDate
,
endDate
)
return
DoCalcGroupPowerMonthRankAct
(
model
,
calcMonth
,
beginDate
,
endDate
,
starDate
)
}
func
DoCalcGroupPowerMonthRankAct
(
model
*
domain
.
Model
,
calcMonth
,
beginDate
,
endDate
string
)
error
{
func
DoCalcGroupPowerMonthRankAct
(
model
*
domain
.
Model
,
calcMonth
,
beginDate
,
endDate
,
starDate
string
)
error
{
areaList
:=
[]
int
{
1
,
2
}
for
_
,
area
:=
range
areaList
{
// 计算获奖
model
:=
domain
.
CreateModelContext
(
model
.
MyContext
)
...
...
@@ -208,7 +209,7 @@ func DoCalcGroupPowerMonthRankAct(model *domain.Model, calcMonth, beginDate, end
powerIds
:=
make
([]
uint64
,
0
,
len
(
response
.
Items
))
for
i
,
v
:=
range
response
.
Items
{
powerIds
=
append
(
powerIds
,
v
.
Id
)
response
.
Items
[
i
]
.
StarList
,
err
=
GetGroupPowerStar
(
model
,
v
.
Id
,
groupPower_e
.
GroupPowerStarTypeFamous
,
0
,
10
,
time
.
Now
()
.
Format
(
utils
.
COMPACT_MONTH_FORMAT
)
)
response
.
Items
[
i
]
.
StarList
,
err
=
GetGroupPowerStar
(
model
,
v
.
Id
,
groupPower_e
.
GroupPowerStarTypeFamous
,
0
,
10
,
starDate
)
if
err
!=
nil
{
return
err
}
...
...
test/group_power_test.go
View file @
739fe8b2
...
...
@@ -38,5 +38,5 @@ func TestDoCalcGroupPowerMonthRankAct(t *testing.T) {
_now
:=
now
.
New
(
lastDayTime
)
calcMonth
:=
_now
.
BeginningOfMonth
()
.
Format
(
utils
.
MONTH_FORMAT
)
beginDate
,
endDate
:=
_now
.
BeginningOfMonth
()
.
Format
(
"2006-01-02"
),
_now
.
EndOfMonth
()
.
Format
(
"2006-01-02"
)
_
=
group_power_s
.
DoCalcGroupPowerMonthRankAct
(
domain
.
CreateModelNil
(),
calcMonth
,
beginDate
,
endDate
)
_
=
group_power_s
.
DoCalcGroupPowerMonthRankAct
(
domain
.
CreateModelNil
(),
calcMonth
,
beginDate
,
endDate
,
""
)
}
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