diff --git a/db/db_user_small_public_platoon_relation.go b/db/db_user_small_public_platoon_relation.go index f2974a6..4211f6a 100644 --- a/db/db_user_small_public_platoon_relation.go +++ b/db/db_user_small_public_platoon_relation.go @@ -95,7 +95,7 @@ func UserSmallPublicPlatoonRelationFindByEmptyPosition(Db *xorm.Engine) (*model. func UserSmallPublicPlatoonRelationGetOneByPid(Db *xorm.Engine, recommendUid string, params map[string]interface{}) (*model.UserSmallPublicPlatoonRelation, error) { var m model.UserSmallPublicPlatoonRelation var query = fmt.Sprintf("%s <=?", params["key"]) - if has, err := Db.Where("recommend_uid = ?", recommendUid).And(query, params["value"]).Get(&m); err != nil || has == false { + if has, err := Db.Where("recommend_uid = ?", recommendUid).And(query, params["value"]).OrderBy("id ASC").Get(&m); err != nil || has == false { return nil, zhios_order_relate_logx.Error(err) } return &m, nil diff --git a/rule/small_public_platoon_relate_commission.go b/rule/small_public_platoon_relate_commission.go index ce41370..fc6de21 100644 --- a/rule/small_public_platoon_relate_commission.go +++ b/rule/small_public_platoon_relate_commission.go @@ -246,7 +246,7 @@ func smallPublicPlatoon(engine *xorm.Engine, uid, recommendUid int, userPublicPl standardSmallPublicPlatoonRelation.LevelTotal = m.LevelTotal + 1 } else { //TODO::判断直属下级是否排满 - if len(userSmallPublicPlatoonRelations) == userPublicPlatoonSetting.SeveralTimes { + if len(userSmallPublicPlatoonRelations) >= userPublicPlatoonSetting.SeveralTimes { var fatherLevel float64 smallMakeSearchLevel(&m.Position, float64(userPublicPlatoonSetting.SeveralTimes), &fatherLevel) var times = 0