From ce0702f1acf5af707862b9779b7f71135fd9de21 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 24 Mar 2023 16:15:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/db_regional_agent_user_belong.go | 2 +- db/db_regional_sub_agent_user_belong.go | 2 +- lib/comm_plan/ds_check.go | 2 +- lib/comm_plan/init.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/db/db_regional_agent_user_belong.go b/db/db_regional_agent_user_belong.go index 397ac33..0e8b45f 100644 --- a/db/db_regional_agent_user_belong.go +++ b/db/db_regional_agent_user_belong.go @@ -207,7 +207,7 @@ func RegionalAgentRegionGetOneByParams(Db *xorm.Engine, params map[string]interf func RegionalAgentUserFindByValid(Db *xorm.Engine, regionId string) (*[]model.RegionalAgentUser, error) { var m []model.RegionalAgentUser - err := Db.Where("region_id=? and deleted_time IS NULL", regionId).Find(&m) + err := Db.Where("region_id=? and deleted_time IS NULL and is_failure=0", regionId).Find(&m) if err != nil { return nil, err } diff --git a/db/db_regional_sub_agent_user_belong.go b/db/db_regional_sub_agent_user_belong.go index 34a63e0..58de08a 100644 --- a/db/db_regional_sub_agent_user_belong.go +++ b/db/db_regional_sub_agent_user_belong.go @@ -16,7 +16,7 @@ func RegionalSubAgentOrdBelongInsert(Db *xorm.Engine, RegionalSubAgentRegion *mo func RegionalSubAgentUserFindByValid(Db *xorm.Engine, regionId string) (*[]model.RegionalAgentSubUser, error) { var m []model.RegionalAgentSubUser - err := Db.Where("region_id=? and deleted_time IS NULL", regionId).Find(&m) + err := Db.Where("region_id=? and deleted_time IS NULL and is_failure=0", regionId).Find(&m) if err != nil { return nil, err } diff --git a/lib/comm_plan/ds_check.go b/lib/comm_plan/ds_check.go index 4ed5be9..e5e9b5a 100644 --- a/lib/comm_plan/ds_check.go +++ b/lib/comm_plan/ds_check.go @@ -172,7 +172,7 @@ Loop: //如果设置了直推奖励 就拿前一个用户的佣金 //同级奖励比例 需要满足直推 X个以上同等级用户 if len(opt.UserRate[maxLv].SameUserCount) > peerNum { - userCount := opt.UserRate[maxLv].SameUserCount[peerNum] + userCount := opt.UserRate[maxLv].SameUserCount sql := `SELECT COUNT(*) as count FROM user_profile up LEFT JOIN user u on u.uid=up.uid WHERE up.parent_uid=? and u.level=?; diff --git a/lib/comm_plan/init.go b/lib/comm_plan/init.go index be3f2da..7f9dc03 100644 --- a/lib/comm_plan/init.go +++ b/lib/comm_plan/init.go @@ -66,7 +66,7 @@ type LvGrade struct { NewTeamList map[string]string `json:"new_team_list"` // 新团队比例 NewExtendList map[string]string `json:"new_extend_list"` // 直推比例 SecondExtendList map[string]string `json:"second_extend_list"` // 直推比例 - SameUserCount []string `json:"same_user_count"` + SameUserCount string `json:"same_user_count"` SameExtend []map[string]string `json:"same_extend"` SubsidyModeList map[string]interface{} `json:"subsidy_mode_list"` // 各币种返佣模式:bili:比例 money:固定金额 //SubsidyBlockIconsMode string `json:"subsidy_block_icons_mode"` //分销 区块币返利类型 bili 比例 money 固定金额