|
|
@@ -174,6 +174,15 @@ func (p PublicPlatoonUserRelationDb) PublicPlatoonUserRelationGetOneByUid(uid in |
|
|
|
return &parent, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (p PublicPlatoonUserRelationDb) PublicPlatoonUserRelationGetOneByPosition(position int64) (*model.PublicPlatoonUserRelation, error) { |
|
|
|
var relation model.PublicPlatoonUserRelation |
|
|
|
_, err := p.Db.Where("position = ?", position).Get(&relation) |
|
|
|
if err != nil { |
|
|
|
return nil, zhios_order_relate_logx.Error(err) |
|
|
|
} |
|
|
|
return &relation, nil |
|
|
|
} |
|
|
|
|
|
|
|
func (p PublicPlatoonUserRelationDb) GetTreeBySmall(head *model.PublicPlatoonUserRelation, leveLimit int) ([]*model.PublicPlatoonUserRelation, error) { |
|
|
|
if leveLimit == 0 { |
|
|
|
leveLimit = 1 |
|
|
@@ -193,7 +202,7 @@ func (p PublicPlatoonUserRelationDb) GetTreeBySmall(head *model.PublicPlatoonUse |
|
|
|
if err1 != nil { |
|
|
|
return nil, zhios_order_relate_logx.Error(err1) |
|
|
|
} |
|
|
|
res = append(res, son...) |
|
|
|
queue = append(queue, son...) |
|
|
|
} |
|
|
|
return res, nil |
|
|
|
} |