Bläddra i källkod

update 绿色双链积分

master
DengBiao 9 månader sedan
förälder
incheckning
6a1fd91277
1 ändrade filer med 6 tillägg och 11 borttagningar
  1. +6
    -11
      rule/green_coin_double_chain_settlement.go

+ 6
- 11
rule/green_coin_double_chain_settlement.go Visa fil

@@ -62,6 +62,7 @@ func DealUserGreenCoinDoubleChainIntegral(Db *xorm.Engine, uid int, ordId, maste
}

func HandleUserGreenCoinDoubleChainIntegralByParent(Db *xorm.Engine, uid int, ordId, masterId string, greenCoinDoubleChain *model.GreenCoinDoubleChain) (err error) {
time.Sleep(time.Millisecond * 200) //TODO::等待100毫秒
//1、查找对应直推上级用户
parentUserRelate, err := db.GetUserParentUserRelate(Db, uid)
if err != nil {
@@ -130,9 +131,6 @@ func HandleUserGreenCoinDoubleChainIntegralByParent(Db *xorm.Engine, uid int, or
}
}()
for _, v := range sonUserVirtualWallet {
if lastUid == -1 {
break
}

userAmount, _ := decimal.NewFromString(v.Amount)
if amount == "" {
@@ -264,13 +262,13 @@ func HandleUserGreenCoinDoubleChainIntegralByParent(Db *xorm.Engine, uid int, or
}

if zhios_order_relate_utils.StrToFloat64(afterUserCoinAmount) == 0 {
lastUid = -1
break
} else {
amount = afterCoinAmountContributeUser1
lastUid = v.Uid
}
if zhios_order_relate_utils.StrToFloat64(amount) == 0 {
break
amount = ""
}
}
session.Commit()
@@ -278,6 +276,7 @@ func HandleUserGreenCoinDoubleChainIntegralByParent(Db *xorm.Engine, uid int, or
}

func HandleUserGreenCoinDoubleChainIntegralBySon(Db *xorm.Engine, uid int, ordId, masterId string, greenCoinDoubleChain *model.GreenCoinDoubleChain) (err error) {
time.Sleep(time.Millisecond * 200) //TODO::等待100毫秒
//1、查询对应上级的虚拟币余额
parentAmount, err := svc.GetUserCoinAmount(Db.NewSession(), masterId, greenCoinDoubleChain.Coin1, uid)
if err != nil {
@@ -337,10 +336,6 @@ func HandleUserGreenCoinDoubleChainIntegralBySon(Db *xorm.Engine, uid int, ordId
}()
for _, v := range sonUserVirtualWallet {

if lastUid == -1 {
break
}

userAmount, _ := decimal.NewFromString(v.Amount)
if amount == "" {
amount = userAmount.String()
@@ -469,13 +464,13 @@ func HandleUserGreenCoinDoubleChainIntegralBySon(Db *xorm.Engine, uid int, ordId
}

if zhios_order_relate_utils.StrToFloat64(afterUserCoinAmount) == 0 {
lastUid = -1
break
} else {
amount = afterCoinAmountContributeUser1
lastUid = v.Uid
}
if zhios_order_relate_utils.StrToFloat64(amount) == 0 {
break
amount = ""
}
}
session.Commit()


Laddar…
Avbryt
Spara