mirror of
https://github.com/mindoc-org/mindoc.git
synced 2026-02-27 17:03:57 +08:00
增加清理附件按钮,对悬空无引用的图片/附件进行清理 (#918)
* add attach_clean & change_theme * add attach_clean & change_theme * add * add readme --------- Co-authored-by: root <root@DESKTOP-L84EQPB.localdomain>
This commit is contained in:
@@ -102,11 +102,15 @@ func (m *Attachment) FindToPager(pageIndex, pageSize int) (attachList []*Attachm
|
||||
return nil, 0, err
|
||||
}
|
||||
totalCount = int(total)
|
||||
offset := (pageIndex - 1) * pageSize
|
||||
|
||||
var list []*Attachment
|
||||
|
||||
_, err = o.QueryTable(m.TableNameWithPrefix()).OrderBy("-attachment_id").Offset(offset).Limit(pageSize).All(&list)
|
||||
offset := (pageIndex - 1) * pageSize
|
||||
if pageSize == 0 {
|
||||
_, err = o.QueryTable(m.TableNameWithPrefix()).OrderBy("-attachment_id").Offset(offset).Limit(pageSize).All(&list)
|
||||
} else {
|
||||
_, err = o.QueryTable(m.TableNameWithPrefix()).OrderBy("-attachment_id").All(&list)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
if err == orm.ErrNoRows {
|
||||
|
||||
Reference in New Issue
Block a user