mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-04-05 20:17:53 +08:00
feat:跳转项目排序
This commit is contained in:
parent
f9a214199d
commit
6ca1515462
@ -28,12 +28,12 @@ func (c *HomeController) Index() {
|
||||
pageIndex, _ := c.GetInt("page", 1)
|
||||
pageSize := 18
|
||||
|
||||
member_id := 0
|
||||
memberId := 0
|
||||
|
||||
if c.Member != nil {
|
||||
member_id = c.Member.MemberId
|
||||
memberId = c.Member.MemberId
|
||||
}
|
||||
books, totalCount, err := models.NewBook().FindForHomeToPager(pageIndex, pageSize, member_id)
|
||||
books, totalCount, err := models.NewBook().FindForHomeToPager(pageIndex, pageSize, memberId)
|
||||
|
||||
if err != nil {
|
||||
beego.Error(err)
|
||||
|
@ -499,7 +499,7 @@ WHERE book.privately_owned = 0 or rel.role_id >=0 or team.role_id >=0`
|
||||
as t group by book_id) as team on team.book_id=book.book_id
|
||||
LEFT JOIN md_relationship AS rel1 ON rel1.book_id = book.book_id AND rel1.role_id = 0
|
||||
LEFT JOIN md_members AS member ON rel1.member_id = member.member_id
|
||||
WHERE book.privately_owned = 0 or rel.role_id >=0 or team.role_id >=0 ORDER BY order_index ,book.book_id DESC LIMIT ?,?`
|
||||
WHERE book.privately_owned = 0 or rel.role_id >=0 or team.role_id >=0 ORDER BY order_index desc,book.book_id DESC LIMIT ?,?`
|
||||
|
||||
_, err = o.Raw(sql2, memberId, memberId, offset, pageSize).QueryRows(&books)
|
||||
|
||||
|
@ -244,7 +244,7 @@ as t group by book_id) as team
|
||||
LEFT JOIN md_relationship AS rel1 ON rel1.book_id = book.book_id AND rel1.role_id = 0
|
||||
LEFT JOIN md_members AS member ON rel1.member_id = member.member_id
|
||||
WHERE book.item_id = ? AND (book.privately_owned = 0 or rel.role_id >= 0 or team.role_id >= 0)
|
||||
ORDER BY order_index ,book.book_id DESC LIMIT ?,?`
|
||||
ORDER BY order_index desc,book.book_id DESC LIMIT ?,?`
|
||||
|
||||
_, err = o.Raw(sql2, memberId, memberId, item.ItemId, offset, pageSize).QueryRows(&books)
|
||||
|
||||
@ -262,7 +262,7 @@ as t group by book_id) as team
|
||||
sql := `SELECT book.*,rel.*,member.account AS create_name FROM md_books AS book
|
||||
LEFT JOIN md_relationship AS rel ON rel.book_id = book.book_id AND rel.role_id = 0
|
||||
LEFT JOIN md_members AS member ON rel.member_id = member.member_id
|
||||
WHERE book.item_id = ? AND book.privately_owned = 0 ORDER BY order_index ,book.book_id DESC LIMIT ?,?`
|
||||
WHERE book.item_id = ? AND book.privately_owned = 0 ORDER BY order_index desc,book.book_id DESC LIMIT ?,?`
|
||||
|
||||
_, err = o.Raw(sql, item.ItemId, offset, pageSize).QueryRows(&books)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user