Commit 1424feed by mushishixian

fix

parent 8966b5e9
Showing with 3 additions and 1 deletions
...@@ -86,11 +86,13 @@ func main() { ...@@ -86,11 +86,13 @@ func main() {
//首先去找最后的更新时间,一般来说找统计表最后一条记录的时间就对了 //首先去找最后的更新时间,一般来说找统计表最后一条记录的时间就对了
updateTime, _ := specialDb.Reset().Table("lie_activity_statistics").OrderBy("id desc").Value("update_time") updateTime, _ := specialDb.Reset().Table("lie_activity_statistics").OrderBy("id desc").Value("update_time")
if updateTime.(int64) == 0 {
updateTime = 1
}
//先去取出所有的正在进行的活动列表 //先去取出所有的正在进行的活动列表
var giftActivityList []model.GiftActivity var giftActivityList []model.GiftActivity
err = specialDb.Reset().Table(&giftActivityList).Fields("id,start_time,end_time").Where("status", "!=", -1). err = specialDb.Reset().Table(&giftActivityList).Fields("id,start_time,end_time").Where("status", "!=", -1).
Where("end_time", ">", updateTime).Select() Where("end_time", ">", updateTime).Select()
fmt.Println(specialDb.LastSql())
if err != nil { if err != nil {
fmt.Println(err.Error()) fmt.Println(err.Error())
logger.Error(err.Error()) logger.Error(err.Error())
......
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