Browse Source

更新

master
huangjiajun 5 months ago
parent
commit
f7007d4825
3 changed files with 19 additions and 6 deletions
  1. +9
    -0
      db/db_regional_agent_user_belong.go
  2. +5
    -3
      rule/regional_agent.go
  3. +5
    -3
      rule/regional_sub_agent.go

+ 9
- 0
db/db_regional_agent_user_belong.go View File

@@ -255,6 +255,15 @@ func VirtualCoinFindByParams(Db *xorm.Engine, params map[string]interface{}) (*[


} }
} }
func VirtualCoinFindByAll(Db *xorm.Engine) (*[]model.VirtualCoin, error) {
var m []model.VirtualCoin
//查询全部数据
err := Db.Find(&m)
if err != nil {
return nil, err
}
return &m, nil
}
func RegionalAgentCalcSystemRelateInsert(Db *xorm.Engine, regionalAgentCalcSystemRelate *model.RegionalAgentCalcSystemRelate) (int64, error) { func RegionalAgentCalcSystemRelateInsert(Db *xorm.Engine, regionalAgentCalcSystemRelate *model.RegionalAgentCalcSystemRelate) (int64, error) {
_, err := Db.InsertOne(regionalAgentCalcSystemRelate) _, err := Db.InsertOne(regionalAgentCalcSystemRelate)
if err != nil { if err != nil {


+ 5
- 3
rule/regional_agent.go View File

@@ -77,13 +77,15 @@ func HandleCommissionDistributionSystem(engine *xorm.Engine, args *md.RegionalAg
} }


//查询 virtual_coin 获取虚拟货币的 “兑换比例” //查询 virtual_coin 获取虚拟货币的 “兑换比例”
virtualCoin, err := db.VirtualCoinFindByParams(engine, map[string]interface{}{})
virtualCoin, err := db.VirtualCoinFindByAll(engine)
if err != nil { if err != nil {
return nil, false return nil, false
} }
var virtualCoinMap = map[int]string{} var virtualCoinMap = map[int]string{}
for _, v := range *virtualCoin {
virtualCoinMap[v.Id] = v.ExchangeRatio
if virtualCoin != nil {
for _, v := range *virtualCoin {
virtualCoinMap[v.Id] = v.ExchangeRatio
}
} }
//查询代理网点的代理(网点、区、市、省)信息 //查询代理网点的代理(网点、区、市、省)信息
var parents, tempParents []map[string]interface{} var parents, tempParents []map[string]interface{}


+ 5
- 3
rule/regional_sub_agent.go View File

@@ -77,13 +77,15 @@ func HandleSubCommissionDistributionSystem(engine *xorm.Engine, args *md.Regiona
} }


//查询 virtual_coin 获取虚拟货币的 “兑换比例” //查询 virtual_coin 获取虚拟货币的 “兑换比例”
virtualCoin, err := db.VirtualCoinFindByParams(engine, map[string]interface{}{})
virtualCoin, err := db.VirtualCoinFindByAll(engine)
if err != nil { if err != nil {
return nil, false return nil, false
} }
var virtualCoinMap = map[int]string{} var virtualCoinMap = map[int]string{}
for _, v := range *virtualCoin {
virtualCoinMap[v.Id] = v.ExchangeRatio
if virtualCoin != nil {
for _, v := range *virtualCoin {
virtualCoinMap[v.Id] = v.ExchangeRatio
}
} }
//查询代理网点的代理(网点、区、市、省)信息 //查询代理网点的代理(网点、区、市、省)信息
var parents, tempParents []map[string]interface{} var parents, tempParents []map[string]interface{}


Loading…
Cancel
Save