mirror of https://github.com/mindoc-org/mindoc.git
parent
31b628060b
commit
2d3b0ab674
|
@ -895,18 +895,22 @@ func (c *BookController) TeamDelete() {
|
|||
|
||||
teamId, _ := c.GetInt("teamId")
|
||||
|
||||
if teamId <= 0 {
|
||||
c.JsonResult(5001,"参数错误")
|
||||
}
|
||||
book, err := c.IsPermission()
|
||||
|
||||
if err != nil {
|
||||
c.JsonResult(500, err.Error())
|
||||
c.JsonResult(5002, err.Error())
|
||||
}
|
||||
beego.Error(book)
|
||||
err = models.NewTeamRelationship().DeleteByBookId(book.BookId, teamId)
|
||||
|
||||
if err != nil {
|
||||
if err == orm.ErrNoRows {
|
||||
c.JsonResult(500, "团队未加入项目")
|
||||
c.JsonResult(5003, "团队未加入项目")
|
||||
}
|
||||
c.JsonResult(500, err.Error())
|
||||
c.JsonResult(5004, err.Error())
|
||||
}
|
||||
c.JsonResult(0, "OK")
|
||||
}
|
||||
|
|
|
@ -75,7 +75,8 @@ func (m *TeamRelationship) DeleteByBookId(bookId int, teamId int) error {
|
|||
beego.Error("查询项目团队失败 ->", err)
|
||||
return err
|
||||
}
|
||||
return m.Delete(teamId)
|
||||
m.Include()
|
||||
return m.Delete(m.TeamRelationshipId)
|
||||
}
|
||||
|
||||
//保存团队项目.
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
<ul class="menu">
|
||||
<li class="active"><a href="{{urlfor "BookController.Dashboard" ":key" .Model.Identify}}" class="item"><i class="fa fa-dashboard" aria-hidden="true"></i> 概要</a> </li>
|
||||
<li><a href="{{urlfor "BookController.Users" ":key" .Model.Identify}}" class="item"><i class="fa fa-user" aria-hidden="true"></i> 成员</a> </li>
|
||||
<li><a href="{{urlfor "BookController.Team" ":key" .Model.Identify}}" class="item"><i class="fa fa-group" aria-hidden="true"></i> 团队</a> </li>
|
||||
{{if eq .Model.RoleId 0 1}}
|
||||
<li><a href="{{urlfor "BookController.Setting" ":key" .Model.Identify}}" class="item"><i class="fa fa-gear" aria-hidden="true"></i> 设置</a> </li>
|
||||
<li><a href="{{urlfor "BookController.Team" ":key" .Model.Identify}}" class="item"><i class="fa fa-group" aria-hidden="true"></i> 团队</a> </li>
|
||||
<li><a href="{{urlfor "BookController.Setting" ":key" .Model.Identify}}" class="item"><i class="fa fa-gear" aria-hidden="true"></i> 设置</a> </li>
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@
|
|||
<ul class="menu">
|
||||
<li><a href="{{urlfor "BookController.Dashboard" ":key" .Model.Identify}}" class="item"><i class="fa fa-dashboard" aria-hidden="true"></i> 概要</a></li>
|
||||
<li><a href="{{urlfor "BookController.Users" ":key" .Model.Identify}}" class="item"><i class="fa fa-user" aria-hidden="true"></i> 成员</a></li>
|
||||
<li class="active"><a href="{{urlfor "BookController.Team" ":key" .Model.Identify}}" class="item"><i class="fa fa-group" aria-hidden="true"></i> 团队</a></li>
|
||||
{{if eq .Model.RoleId 0 1}}
|
||||
<li class="active"><a href="{{urlfor "BookController.Team" ":key" .Model.Identify}}" class="item"><i class="fa fa-group" aria-hidden="true"></i> 团队</a></li>
|
||||
<li><a href="{{urlfor "BookController.Setting" ":key" .Model.Identify}}" class="item"><i class="fa fa-gear" aria-hidden="true"></i> 设置</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
|
|
|
@ -23,10 +23,10 @@
|
|||
<ul class="menu">
|
||||
<li><a href="{{urlfor "BookController.Dashboard" ":key" .Model.Identify}}" class="item"><i class="fa fa-dashboard" aria-hidden="true"></i> 概要</a> </li>
|
||||
<li class="active"><a href="{{urlfor "BookController.Users" ":key" .Model.Identify}}" class="item"><i class="fa fa-user" aria-hidden="true"></i> 成员</a> </li>
|
||||
<li><a href="{{urlfor "BookController.Team" ":key" .Model.Identify}}" class="item"><i class="fa fa-group" aria-hidden="true"></i> 团队</a> </li>
|
||||
{{if eq .Model.RoleId 0 1}}
|
||||
<li><a href="{{urlfor "BookController.Team" ":key" .Model.Identify}}" class="item"><i class="fa fa-group" aria-hidden="true"></i> 团队</a> </li>
|
||||
<li><a href="{{urlfor "BookController.Setting" ":key" .Model.Identify}}" class="item"><i class="fa fa-gear" aria-hidden="true"></i> 设置</a> </li>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue