From 33937f36600b8ed28fca30a925ada65f0cab0317 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 7 Dec 2022 16:15:03 +0800 Subject: [PATCH] =?UTF-8?q?add=20reverse:for=20v4.2.6=20=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E4=BB=A3=E7=90=86=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/db_regional_agent_user_belong.go | 4 ++-- rule/regional_agent.go | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/db/db_regional_agent_user_belong.go b/db/db_regional_agent_user_belong.go index 2e3463e..397ac33 100644 --- a/db/db_regional_agent_user_belong.go +++ b/db/db_regional_agent_user_belong.go @@ -174,12 +174,12 @@ func GetCountByRegionalAgentUserBelongById(Db *xorm.Engine, uid interface{}, pvd } fmt.Println(pvd) if pvd == md.PVD_COMMON { - if has, err := Db.Where("uid = ? and (pvd='' or pvd=?)", uid, pvd).Get(&m); err != nil || has == false { + if has, err := Db.Where("uid = ? and (pvd='' or pvd=?)", uid, pvd).Desc("id").Get(&m); err != nil || has == false { return nil, err } return &m, nil } else { - if has, err := Db.Where("uid = ? and pvd=?", uid, pvd).Get(&m); err != nil || has == false { + if has, err := Db.Where("uid = ? and pvd=?", uid, pvd).Desc("id").Get(&m); err != nil || has == false { return nil, err } return &m, nil diff --git a/rule/regional_agent.go b/rule/regional_agent.go index 942cd39..39d7692 100644 --- a/rule/regional_agent.go +++ b/rule/regional_agent.go @@ -62,6 +62,9 @@ func HandleCommissionDistributionSystem(engine *xorm.Engine, args *md.RegionalAg if err != nil { return nil, false } + if regionalAgentRegion == nil { + return nil, true + } //查询 regional_agent_base 表获取虚拟币相关配置信息 agentBase, err := db.GetCountByRegionalAgentBase(engine) if err != nil {