We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4112337 commit eee8f32Copy full SHA for eee8f32
service/app/controller/blog/articledetail.js
@@ -39,8 +39,8 @@ class ArticleDetailController extends controller {
39
article
40
SET view_count = view_count + 1
41
WHERE article.id = ? AND article.is_publish = 1`;
42
- const result = await this.app.mysql.query(sql, [id]);
43
- if (result.length > 0) {
+ const updateResult = await this.app.mysql.query(sql, [id]);
+ if (updateResult.affectedRows === 1) {
44
this.ctx.body = {
45
success: true,
46
};
0 commit comments