diff --git a/rule/small_public_platoon_relate_commission.go b/rule/small_public_platoon_relate_commission.go index 39494c0..a869427 100644 --- a/rule/small_public_platoon_relate_commission.go +++ b/rule/small_public_platoon_relate_commission.go @@ -46,6 +46,17 @@ func AddSmallPublicPlatoonRelateCommission(engine *xorm.Engine, AddSmallPublicPl return nil, err } 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、判断是否有推荐人 if param.RecommendUid != "" { //2、有推荐人 @@ -915,7 +926,7 @@ func SmallDealCommonWealthPunish(engine *xorm.Engine, uid int, reason string) (e return } - //2、查询出 `user_public_platoon_relation` 中相关记录 && 将该记录的uid置为 -1 + //2、查询出 `user_small_public_platoon_relation` 中相关记录 && 将该记录的uid置为 -1 params, err := db.UserSmallPublicPlatoonRelationGetOneByParams(engine, map[string]interface{}{ "key": "uid", "value": uid, @@ -925,15 +936,15 @@ func SmallDealCommonWealthPunish(engine *xorm.Engine, uid int, reason string) (e return } if params == nil { - err = errors.New("未查询到公排关系记录") + fmt.Println("未查询到公排关系记录!!!!!!!", uid) _ = session.Rollback() } //TODO::判断是否为推荐用户 if params.RecommendUid == 0 { - params.Uid = params.Uid - 2147483648 + params.Uid = params.Uid - int(time.Now().Unix()) } else { - params.Uid = params.Uid - 2147483648 + params.Uid = params.Uid - int(time.Now().Unix()) } for n := 1; n <= 9; n++ {