From 12b7d58865b566c367bb0ad151d5f11558255b70 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Sat, 19 Nov 2022 17:22:41 +0800 Subject: [PATCH] add reverse:for v3.8.1 test --- db/db_integral_release_basic.go | 12 ++++++++++++ rule/integral_release_settlement.go | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/db/db_integral_release_basic.go b/db/db_integral_release_basic.go index 0198de7..9aac333 100644 --- a/db/db_integral_release_basic.go +++ b/db/db_integral_release_basic.go @@ -87,6 +87,18 @@ func IntegralReleaseGetOneByParams(session *xorm.Session, params map[string]inte } return &m, nil } +func IntegralReleaseGetOneByParamsEg(eg *xorm.Engine, params map[string]interface{}) (*model.IntegralReleaseBasic, error) { + var m model.IntegralReleaseBasic + var query = fmt.Sprintf("%s =?", params["key"]) + has, err := eg.Where(query, params["value"]).Get(&m) + if err != nil { + return nil, zhios_order_relate_logx.Error(err) + } + if has == false { + return nil, errors.New("未查询到相应的 block_star_chain 记录") + } + return &m, nil +} // IntegralReleaseFindByParams 通过传入的参数查询数据(多条) func IntegralReleaseFindByParams(Db *xorm.Engine, params map[string]interface{}) (*[]model.IntegralReleaseBasic, error) { diff --git a/rule/integral_release_settlement.go b/rule/integral_release_settlement.go index 1dc5a68..3946e0d 100644 --- a/rule/integral_release_settlement.go +++ b/rule/integral_release_settlement.go @@ -78,7 +78,7 @@ func DailySettlementIntegralRelease(engine *xorm.Engine, mid string, isTask bool //2、查询所有 `integral_release_user_with_ord` 记录 integralReleaseUserWithOrds, err := db.IntegralReleaseUserWithOrdFindByParams(session, map[string]interface{}{ - "state": "is_use", + "key": "state", "value": 1, }) for _, ord := range *integralReleaseUserWithOrds {