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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 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
...
@@ -103,7 +105,7 @@ func (as *ActivityService) GetGiftActivity(checkData model.ActivityCheckData, ac
...
@@ -103,7 +105,7 @@ func (as *ActivityService) GetGiftActivity(checkData model.ActivityCheckData, ac
ActivityId
:
activity
.
ActivityId
,
ActivityId
:
activity
.
ActivityId
,
ActivityName
:
activity
.
ActivityName
,
ActivityName
:
activity
.
ActivityName
,
AllowCoupon
:
activity
.
AllowCoupon
,
AllowCoupon
:
activity
.
AllowCoupon
,
UserScope
:
activity
.
UserScope
,
UserScope
:
activity
.
UserScope
,
},
},
}
}
}
}
...
@@ -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
...
@@ -183,7 +187,7 @@ func (as *ActivityService) GetPriceActivity(checkData model.ActivityCheckData, a
...
@@ -183,7 +187,7 @@ func (as *ActivityService) GetPriceActivity(checkData model.ActivityCheckData, a
ActivityId
:
activity
.
ActivityId
,
ActivityId
:
activity
.
ActivityId
,
ActivityName
:
activity
.
ActivityName
,
ActivityName
:
activity
.
ActivityName
,
AllowCoupon
:
activity
.
AllowCoupon
,
AllowCoupon
:
activity
.
AllowCoupon
,
UserScope
:
activity
.
UserScope
,
UserScope
:
activity
.
UserScope
,
},
},
}
}
}
}
...
...
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