dengbiao 8 mesi fa
parent
commit
1a3e6771b4
1 ha cambiato i file con 15 aggiunte e 4 eliminazioni
  1. +15
    -4
      rule/small_public_platoon_relate_commission.go

+ 15
- 4
rule/small_public_platoon_relate_commission.go Vedi File

@@ -46,6 +46,17 @@ func AddSmallPublicPlatoonRelateCommission(engine *xorm.Engine, AddSmallPublicPl
return nil, err return nil, err
} }
for _, param := range AddSmallPublicPlatoonRelateCommissionReqList { for _, param := range AddSmallPublicPlatoonRelateCommissionReqList {
isHasPublicPlatoonUserRelation, err11 := db.UserSmallPublicPlatoonRelationGetOneByParams(engine, map[string]interface{}{
"key": "uid",
"value": param.Uid,
})
if err11 != nil {
return nil, err11
}
if isHasPublicPlatoonUserRelation != nil {
return nil, errors.New("当前用户已加入公排")
}

//1、判断是否有推荐人 //1、判断是否有推荐人
if param.RecommendUid != "" { if param.RecommendUid != "" {
//2、有推荐人 //2、有推荐人
@@ -915,7 +926,7 @@ func SmallDealCommonWealthPunish(engine *xorm.Engine, uid int, reason string) (e
return return
} }


//2、查询出 `user_public_platoon_relation` 中相关记录 && 将该记录的uid置为 -1
//2、查询出 `user_small_public_platoon_relation` 中相关记录 && 将该记录的uid置为 -1
params, err := db.UserSmallPublicPlatoonRelationGetOneByParams(engine, map[string]interface{}{ params, err := db.UserSmallPublicPlatoonRelationGetOneByParams(engine, map[string]interface{}{
"key": "uid", "key": "uid",
"value": uid, "value": uid,
@@ -925,15 +936,15 @@ func SmallDealCommonWealthPunish(engine *xorm.Engine, uid int, reason string) (e
return return
} }
if params == nil { if params == nil {
err = errors.New("未查询到公排关系记录")
fmt.Println("未查询到公排关系记录!!!!!!!", uid)
_ = session.Rollback() _ = session.Rollback()
} }


//TODO::判断是否为推荐用户 //TODO::判断是否为推荐用户
if params.RecommendUid == 0 { if params.RecommendUid == 0 {
params.Uid = params.Uid - 2147483648
params.Uid = params.Uid - int(time.Now().Unix())
} else { } else {
params.Uid = params.Uid - 2147483648
params.Uid = params.Uid - int(time.Now().Unix())
} }


for n := 1; n <= 9; n++ { for n := 1; n <= 9; n++ {


Caricamento…
Annulla
Salva