mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Fix: cannot list multiple pages in async task page
This commit is contained in:
@@ -64,7 +64,7 @@ func ListTasks(uid uint, page, pageSize int, order string) ([]Task, int) {
|
|||||||
dbChain = dbChain.Where("user_id = ?", uid)
|
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)
|
dbChain.Limit(pageSize).Offset((page - 1) * pageSize).Order(order).Find(&tasks)
|
||||||
|
|||||||
Reference in New Issue
Block a user