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
97beeb3a
Commit
97beeb3a
authored
Apr 20, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
家族贡献排行自动发奖
parent
fbf01a1e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
group_power.go
domain/service/group_power_s/group_power.go
+4
-0
group_power_test.go
test/group_power_test.go
+12
-0
No files found.
domain/service/group_power_s/group_power.go
View file @
97beeb3a
...
...
@@ -189,6 +189,10 @@ func CalcGroupPowerMonthRankAct(model *domain.Model) error {
_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"
)
return
DoCalcGroupPowerMonthRankAct
(
model
,
calcMonth
,
beginDate
,
endDate
)
}
func
DoCalcGroupPowerMonthRankAct
(
model
*
domain
.
Model
,
calcMonth
,
beginDate
,
endDate
string
)
error
{
// 计算获奖
response
,
err
:=
GetGroupPowerRankResp
(
model
,
beginDate
,
endDate
,
0
)
if
err
!=
nil
{
...
...
test/group_power_test.go
View file @
97beeb3a
...
...
@@ -3,9 +3,13 @@ package test
import
(
"fmt"
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/utils"
"github.com/jinzhu/now"
"hilo-group/domain/model/groupPower_m"
"hilo-group/domain/model/group_m"
"hilo-group/domain/service/group_power_s"
"testing"
"time"
)
func
TestGetAllGroupPowerOwner
(
t
*
testing
.
T
)
{
...
...
@@ -23,3 +27,11 @@ func TestIsUseTRTC(t *testing.T) {
fmt
.
Println
(
"true--------------"
)
}
}
func
TestDoCalcGroupPowerMonthRankAct
(
t
*
testing
.
T
)
{
lastDayTime
:=
time
.
Now
()
.
AddDate
(
0
,
0
,
-
1
)
_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
)
}
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