Преглед на файлове

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 });