Fix: cannot list multiple pages in async task page

pull/1107/head
HFO4 3 years ago
parent c89327631e
commit 5bda037d74

@ -64,7 +64,7 @@ func ListTasks(uid uint, page, pageSize int, order string) ([]Task, int) {
dbChain = dbChain.Where("user_id = ?", uid)
// 计算总数用于分页
dbChain.Model(&Share{}).Count(&total)
dbChain.Model(&Task{}).Count(&total)
// 查询记录
dbChain.Limit(pageSize).Offset((page - 1) * pageSize).Order(order).Find(&tasks)

Loading…
Cancel
Save