Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
go_sku_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ae234186
authored
Jan 20, 2021
by
mushishixian
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复状态判断
parent
c8992f7f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
model/ly_sku.go
service/service_activity.go
model/ly_sku.go
View file @
ae234186
...
@@ -69,10 +69,10 @@ type LySku struct {
...
@@ -69,10 +69,10 @@ type LySku struct {
type
PriceActivity
struct
{
type
PriceActivity
struct
{
ActivityCommon
ActivityCommon
Ratio
float64
`json:"ratio"`
Ratio
float64
`json:"ratio
,omitempty
"`
SignText
string
`json:"sign_text"`
SignText
string
`json:"sign_text
,omitempty
"`
Sign
string
`json:"sign"`
Sign
string
`json:"sign
,omitempty
"`
ShowName
string
`json:"show_name"`
ShowName
string
`json:"show_name
,omitempty
"`
}
}
type
GiftActivity
struct
{
type
GiftActivity
struct
{
...
...
service/service_activity.go
View file @
ae234186
...
@@ -52,7 +52,9 @@ func (as *ActivityService) GetGiftActivity(checkData model.ActivityCheckData, ac
...
@@ -52,7 +52,9 @@ func (as *ActivityService) GetGiftActivity(checkData model.ActivityCheckData, ac
var
hasActivity
bool
var
hasActivity
bool
nowTimestamp
:=
int
(
time
.
Now
()
.
Unix
())
nowTimestamp
:=
int
(
time
.
Now
()
.
Unix
())
for
_
,
activity
:=
range
activities
{
for
_
,
activity
:=
range
activities
{
if
activity
.
Status
!=
1
{
return
}
//判断时间是否过期
//判断时间是否过期
if
activity
.
StartTime
>
nowTimestamp
||
activity
.
EndTime
<
nowTimestamp
{
if
activity
.
StartTime
>
nowTimestamp
||
activity
.
EndTime
<
nowTimestamp
{
return
return
...
@@ -116,7 +118,9 @@ func (as *ActivityService) GetPriceActivity(checkData model.ActivityCheckData, a
...
@@ -116,7 +118,9 @@ func (as *ActivityService) GetPriceActivity(checkData model.ActivityCheckData, a
var
hasActivity
bool
var
hasActivity
bool
nowTimestamp
:=
int
(
time
.
Now
()
.
Unix
())
nowTimestamp
:=
int
(
time
.
Now
()
.
Unix
())
for
_
,
activity
:=
range
activities
{
for
_
,
activity
:=
range
activities
{
if
activity
.
Status
!=
1
{
return
}
//判断时间是否过期
//判断时间是否过期
if
activity
.
StartTime
>
nowTimestamp
||
activity
.
EndTime
<
nowTimestamp
{
if
activity
.
StartTime
>
nowTimestamp
||
activity
.
EndTime
<
nowTimestamp
{
return
return
...
...
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