Commit ae234186 by mushishixian

修复状态判断

parent c8992f7f
Showing with 10 additions and 6 deletions
......@@ -69,10 +69,10 @@ type LySku struct {
type PriceActivity struct {
ActivityCommon
Ratio float64 `json:"ratio"`
SignText string `json:"sign_text"`
Sign string `json:"sign"`
ShowName string `json:"show_name"`
Ratio float64 `json:"ratio,omitempty"`
SignText string `json:"sign_text,omitempty"`
Sign string `json:"sign,omitempty"`
ShowName string `json:"show_name,omitempty"`
}
type GiftActivity struct {
......
......@@ -52,7 +52,9 @@ func (as *ActivityService) GetGiftActivity(checkData model.ActivityCheckData, ac
var hasActivity bool
nowTimestamp := int(time.Now().Unix())
for _, activity := range activities {
if activity.Status != 1 {
return
}
//判断时间是否过期
if activity.StartTime > nowTimestamp || activity.EndTime < nowTimestamp {
return
......@@ -116,7 +118,9 @@ func (as *ActivityService) GetPriceActivity(checkData model.ActivityCheckData, a
var hasActivity bool
nowTimestamp := int(time.Now().Unix())
for _, activity := range activities {
if activity.Status != 1 {
return
}
//判断时间是否过期
if activity.StartTime > nowTimestamp || activity.EndTime < nowTimestamp {
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment