From b3d594c40287064fd94ab85db8c94b50b93ce00a Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 13 Jul 2023 09:03:39 +0800 Subject: [PATCH] test --- app/db/db_master_list_cfg.go | 16 +++++++++++++--- app/db/db_playlet_sale_order.go | 3 ++- app/task/md/playlet_order.go | 15 ++++++++------- app/task/svc/svc_playlet_adv_order.go | 22 +++++++++++++++------- app/task/svc/svc_playlet_video_order.go | 22 +++++++++++++++------- 5 files changed, 53 insertions(+), 25 deletions(-) diff --git a/app/db/db_master_list_cfg.go b/app/db/db_master_list_cfg.go index 15c10c8..87cad4c 100644 --- a/app/db/db_master_list_cfg.go +++ b/app/db/db_master_list_cfg.go @@ -45,16 +45,26 @@ func (masterListCfgDb *MasterListCfgDb) MasterListCfgGetOneNoDataNoErr(key strin func (masterListCfgDb *MasterListCfgDb) MasterListCfgGetOne(uid, key string) (*model.MasterListCfg, error) { var cfgList model.MasterListCfg - if has, err := masterListCfgDb.Db.Where("`k`=? and uid=?", key, uid).Get(&cfgList); err != nil || has == false { + has, err := masterListCfgDb.Db.Where("`k`=? and uid=?", key, uid).Get(&cfgList) + if err != nil { return nil, logx.Error(err) } + if has == false { + cfgList = model.MasterListCfg{Uid: uid, K: key} + masterListCfgDb.Db.InsertOne(&cfgList) + } return &cfgList, nil } func (masterListCfgDb *MasterListCfgDb) MasterListCfgGetOneData(uid, key string) string { var cfgList model.MasterListCfg - if has, err := masterListCfgDb.Db.Where("`k`=? and uid=?", key, uid).Get(&cfgList); err != nil || has == false { + has, err := masterListCfgDb.Db.Where("`k`=? and uid=?", key, uid).Get(&cfgList) + if err != nil { return "" } + if has == false { + cfgList = model.MasterListCfg{Uid: uid, K: key} + masterListCfgDb.Db.InsertOne(&cfgList) + } return cfgList.V } @@ -70,7 +80,7 @@ func (masterListCfgDb *MasterListCfgDb) MasterListCfgInsert(uid, key, val, memo func (masterListCfgDb *MasterListCfgDb) MasterListCfgUpdate(uid, key, val string) bool { cfg := model.MasterListCfg{K: key, V: val} - _, err := masterListCfgDb.Db.Where("`k`=? and uid=?", key, uid).Cols("val").Update(&cfg) + _, err := masterListCfgDb.Db.Where("`k`=? and uid=?", key, uid).Cols("v").Update(&cfg) if err != nil { logx.Error(err) return false diff --git a/app/db/db_playlet_sale_order.go b/app/db/db_playlet_sale_order.go index 62d4b14..f9226da 100644 --- a/app/db/db_playlet_sale_order.go +++ b/app/db/db_playlet_sale_order.go @@ -76,8 +76,9 @@ func (playletSaleOrderDb *PlayletSaleOrderDb) GetPlayletVideoOrderList(args map[ sess = sess.And("update_time>=?", args["start_time"]) } if args["end_time"] != "" { - sess = sess.And("update_time>=?", args["end_time"]) + sess = sess.And("update_time<=?", args["end_time"]) } + if args["to_settle_time"] != "" { sess = sess.And("create_time