...
|
...
|
@@ -122,10 +122,6 @@ func positionRelationUpdate(positionUpdate models.Position, newparent models.Pos |
|
|
const (
|
|
|
//获取某个职位的下级职位 锁数据 select ... for update
|
|
|
dataSql0 string = `SELECT id,relation FROM position WHERE relation LIKE ? AND delete_at = 0 FOR UPDATE`
|
|
|
//更新关系树
|
|
|
// string = `update position set relation=? where id=?`
|
|
|
//更新departUpdate的parent_id
|
|
|
//dataSql3 string = `update position set parent_id=? where id=?`
|
|
|
)
|
|
|
var (
|
|
|
positionSubset []*models.Position //子级部门
|
...
|
...
|
@@ -136,9 +132,9 @@ func positionRelationUpdate(positionUpdate models.Position, newparent models.Pos |
|
|
)
|
|
|
if newparent.Id == 0 {
|
|
|
//修改节点为顶层节点的情况
|
|
|
newRelation = fmt.Sprintf("%d/", positionUpdate.Id)
|
|
|
newRelation = fmt.Sprintf(",%d,", positionUpdate.Id)
|
|
|
} else {
|
|
|
newRelation = fmt.Sprintf("%s%d/", newparent.Relation, positionUpdate.Id)
|
|
|
newRelation = fmt.Sprintf("%s%d,", newparent.Relation, positionUpdate.Id)
|
|
|
}
|
|
|
o := orm.NewOrm()
|
|
|
o.Begin()
|
...
|
...
|
|