Skip to content

Commit 9d48673

Browse files
author
pedro
committed
fix:修复分页的offset小bug
1 parent 547b0e6 commit 9d48673

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

app/dao/admin.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ class AdminDao {
2828
id: groupId,
2929
admin: UserAdmin.COMMON,
3030
count: count1,
31-
start: start
31+
start: start * count1
3232
}
3333
: {
3434
admin: UserAdmin.COMMON,
3535
count: count1,
36-
start: start
36+
start: start * count1
3737
},
3838
type: db.QueryTypes.SELECT
3939
}
@@ -128,7 +128,7 @@ class AdminDao {
128128
{
129129
replacements: {
130130
count: count1,
131-
start: start
131+
start: start * count1
132132
},
133133
type: db.QueryTypes.SELECT
134134
}

app/dao/log.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class LogDao {
1818
});
1919
let { rows, count } = await Log.findAndCountAll({
2020
where: Object.assign({}, condition),
21-
offset: start,
21+
offset: start * count1,
2222
limit: count1,
2323
order: [["time", "DESC"]]
2424
});
@@ -44,7 +44,7 @@ class LogDao {
4444
[Sequelize.Op.like]: `%${keyword}%`
4545
}
4646
}),
47-
offset: start,
47+
offset: start * count1,
4848
limit: count1,
4949
order: [["time", "DESC"]]
5050
});
@@ -59,7 +59,7 @@ class LogDao {
5959
"SELECT lin_log.user_name AS names FROM lin_log GROUP BY lin_log.user_name HAVING COUNT(lin_log.user_name)>0 limit :count offset :start",
6060
{
6161
replacements: {
62-
start: start,
62+
start: start * count,
6363
count: count
6464
}
6565
}

app/plugins/notify/app/message-dao.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class MessageDao {
2121
user_id: currentUser.id
2222
},
2323
limit: count1,
24-
offset: start
24+
offset: start * count1
2525
});
2626
return {
2727
rows,

0 commit comments

Comments
 (0)