...
|
...
|
@@ -2,7 +2,6 @@ package models |
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
"errors"
|
|
|
"fmt"
|
|
|
"oppmg/common/log"
|
|
|
"oppmg/protocol"
|
...
|
...
|
@@ -12,7 +11,7 @@ import ( |
|
|
)
|
|
|
|
|
|
type Department struct {
|
|
|
Id int64 `orm:"column(id);auto"`
|
|
|
Id int64 `orm:"column(id);pk"`
|
|
|
CompanyId int64 `orm:"column(company_id)" description:"公司id"`
|
|
|
Name string `orm:"column(name);size(30)" description:"部门名称"`
|
|
|
CreateAt time.Time `orm:"column(create_at);type(timestamp)" description:"创建时间"`
|
...
|
...
|
@@ -53,9 +52,6 @@ func (t *Department) SetManages(v []int64) { |
|
|
}
|
|
|
|
|
|
func (t *Department) SetRelation(parent *Department) error {
|
|
|
if t.Id == 0 {
|
|
|
return errors.New("Id==0")
|
|
|
}
|
|
|
if parent == nil {
|
|
|
t.Relation = fmt.Sprintf(",%d,", t.Id)
|
|
|
} else if parent.Id == 0 {
|
...
|
...
|
|