Skip to content

Commit f9d2538

Browse files
committed
fix: 修复status为0情况获取列表数据
1 parent f440281 commit f9d2538

File tree

5 files changed

+6
-5
lines changed

5 files changed

+6
-5
lines changed

app/dao/article.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@ class ArticleDao {
141141
};
142142
}
143143

144-
if (status) {
144+
if (status != null) {
145145
filter.status = status
146146
}
147+
147148
try {
148149
const article = await Article.scope('iv').findAndCountAll({
149150
limit: page_size, //每页10条

app/dao/category.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class CategoryDao {
106106
static async list(query = {}) {
107107
const { status, name, id, page_size = 10, page = 1 } = query
108108
let params = {}
109-
if (status) {
109+
if (status != null) {
110110
params.status = status
111111
}
112112

app/dao/comment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class CommentDao {
141141
if (article_id) {
142142
finner.article_id = article_id
143143
}
144-
if (status) {
144+
if (status != null) {
145145
finner.status = status
146146
}
147147
if (content) {

app/dao/reply.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ class ReplyDao {
293293
if (article_id) {
294294
finner.article_id = article_id
295295
}
296-
if (status) {
296+
if (status != null) {
297297
finner.status = status
298298
}
299299

app/dao/user.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class UserDao {
144144
if(id) {
145145
filter.id = id
146146
}
147-
if(status) {
147+
if (status != null) {
148148
filter.status = status
149149
}
150150
if(username) {

0 commit comments

Comments
 (0)