mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-10-21 03:17:25 +08:00
1、重新实现数据库初始化
2、新增超级管理员可以转让项目 3、新增超级管理员可以公开项目
This commit is contained in:
@@ -160,9 +160,9 @@ func (m *Book) FindToPager(pageIndex, pageSize ,memberId int) (books []*BookResu
|
||||
|
||||
qb2.Select("book.*,rel.member_id","rel.role_id","m.account as create_name").
|
||||
From(m.TableNameWithPrefix() + " AS book").
|
||||
LeftJoin(relationship.TableNameWithPrefix() + " AS rel").
|
||||
On("book.book_id=rel.book_id").
|
||||
LeftJoin(NewMember().TableNameWithPrefix() + " AS m").On("rel.member_id=m.member_id AND rel.role_id=0").
|
||||
LeftJoin(relationship.TableNameWithPrefix() + " AS rel").On("book.book_id=rel.book_id").
|
||||
LeftJoin(relationship.TableNameWithPrefix() + " AS rel1").On("book.book_id=rel1.book_id AND rel.role_id=0").
|
||||
LeftJoin(NewMember().TableNameWithPrefix() + " AS m").On("rel1.member_id=m.member_id").
|
||||
Where("rel.member_id=?").
|
||||
OrderBy("book.order_index DESC ","book.book_id").Desc().
|
||||
Limit(pageSize).
|
||||
|
@@ -47,6 +47,15 @@ func (m *Relationship) Find(id int) (*Relationship,error) {
|
||||
return m,err
|
||||
}
|
||||
|
||||
//查询指定项目的创始人.
|
||||
func (m *Relationship) FindFounder(book_id int) (*Relationship,error) {
|
||||
o := orm.NewOrm()
|
||||
|
||||
err := o.QueryTable(m.TableNameWithPrefix()).Filter("book_id",book_id).Filter("role_id",0).One(m)
|
||||
|
||||
return m,err
|
||||
}
|
||||
|
||||
func (m *Relationship) UpdateRoleId(book_id,member_id, role_id int) (*Relationship,error) {
|
||||
o := orm.NewOrm()
|
||||
book := NewBook()
|
||||
|
Reference in New Issue
Block a user