Browse Source

test

master
huangjiajun 1 year ago
parent
commit
7f9c2dec1b
3 changed files with 8 additions and 4 deletions
  1. +1
    -0
      app/db/db_master_list_cfg.go
  2. +3
    -2
      app/task/svc/svc_playlet_adv_order.go
  3. +4
    -2
      app/task/svc/svc_playlet_video_order.go

+ 1
- 0
app/db/db_master_list_cfg.go View File

@@ -79,6 +79,7 @@ func (masterListCfgDb *MasterListCfgDb) MasterListCfgInsert(uid, key, val, memo
} }


func (masterListCfgDb *MasterListCfgDb) MasterListCfgUpdate(uid, key, val string) bool { func (masterListCfgDb *MasterListCfgDb) MasterListCfgUpdate(uid, key, val string) bool {
masterListCfgDb.MasterListCfgGetOneData(uid, key)
cfg := model.MasterListCfg{K: key, V: val} cfg := model.MasterListCfg{K: key, V: val}
_, err := masterListCfgDb.Db.Where("`k`=? and uid=?", key, uid).Cols("v").Update(&cfg) _, err := masterListCfgDb.Db.Where("`k`=? and uid=?", key, uid).Cols("v").Update(&cfg)
if err != nil { if err != nil {


+ 3
- 2
app/task/svc/svc_playlet_adv_order.go View File

@@ -160,14 +160,15 @@ func PlayletAdvOrderMonth() {
syscfgDb.MasterListCfgUpdate(uid, keyIsEnd, "") syscfgDb.MasterListCfgUpdate(uid, keyIsEnd, "")
runtime = time.Unix(timeRange["start"], 0).Format("2006-01-02 15:04:05") runtime = time.Unix(timeRange["start"], 0).Format("2006-01-02 15:04:05")
} }
syscfgDb.MasterListCfgUpdate(uid, keyStart, time.Now().Format("2006-01-02 15:04:05"))
//当前是否结束了 //当前是否结束了
isEnd := syscfgDb.MasterListCfgGetOneData(uid, keyIsEnd) isEnd := syscfgDb.MasterListCfgGetOneData(uid, keyIsEnd)
if isEnd == "1" { if isEnd == "1" {
return return
} }
var ( var (
beginTime int64 = utils.TimeStdParseUnix(runtime) - 86400
endTime int64 = utils.TimeStdParseUnix(runtime)
beginTime int64 = utils.TimeStdParseUnix(runtime)
endTime int64 = utils.TimeStdParseUnix(runtime) + 86400
pageNo int = 1 pageNo int = 1
pageSize int = 200 pageSize int = 200
) )


+ 4
- 2
app/task/svc/svc_playlet_video_order.go View File

@@ -153,14 +153,16 @@ func PlayletVideoOrderMonth() {
syscfgDb.MasterListCfgUpdate(uid, keyIsEnd, "") syscfgDb.MasterListCfgUpdate(uid, keyIsEnd, "")
runtime = time.Unix(timeRange["start"], 0).Format("2006-01-02 15:04:05") runtime = time.Unix(timeRange["start"], 0).Format("2006-01-02 15:04:05")
} }
syscfgDb.MasterListCfgUpdate(uid, keyStart, time.Now().Format("2006-01-02 15:04:05"))

//当前是否结束了 //当前是否结束了
isEnd := syscfgDb.MasterListCfgGetOneData(uid, keyIsEnd) isEnd := syscfgDb.MasterListCfgGetOneData(uid, keyIsEnd)
if isEnd == "1" { if isEnd == "1" {
return return
} }
var ( var (
beginTime int64 = utils.TimeStdParseUnix(runtime) - 86400
endTime int64 = utils.TimeStdParseUnix(runtime)
beginTime int64 = utils.TimeStdParseUnix(runtime)
endTime int64 = utils.TimeStdParseUnix(runtime) + 86400
pageNo int = 1 pageNo int = 1
pageSize int = 200 pageSize int = 200
) )


Loading…
Cancel
Save