瀏覽代碼

fix: SQL CAST 语法错误,SIGNED BIGINT 改为 SIGNED

ethanfly 3 天之前
父節點
當前提交
2a5b883bdb
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      server/src/services/WorkService.ts

+ 3 - 3
server/src/services/WorkService.ts

@@ -59,9 +59,9 @@ export class WorkService {
       .select([
         'COUNT(*) as totalCount',
         'SUM(CASE WHEN status = "published" THEN 1 ELSE 0 END) as publishedCount',
-        'CAST(SUM(work.playCount) AS SIGNED BIGINT) as totalPlayCount',
-        'CAST(SUM(work.likeCount) AS SIGNED BIGINT) as totalLikeCount',
-        'CAST(SUM(work.commentCount) AS SIGNED BIGINT) as totalCommentCount',
+        'CAST(SUM(work.playCount) AS SIGNED) as totalPlayCount',
+        'CAST(SUM(work.likeCount) AS SIGNED) as totalLikeCount',
+        'CAST(SUM(work.commentCount) AS SIGNED) as totalCommentCount',
       ])
       .where('work.userId = :userId', { userId });