李昊 4 年之前
父节点
当前提交
f0121b34a0
共有 1 个文件被更改,包括 6 次插入8 次删除
  1. 6 8
      GxPress/Repository/GxPress.Repository.Implement/WorkFlow/FlowTodoRepository.cs

+ 6 - 8
GxPress/Repository/GxPress.Repository.Implement/WorkFlow/FlowTodoRepository.cs

@@ -340,6 +340,8 @@ namespace GxPress.Repository.Implement.WorkFlow
                                 tede_process b ON a.ProcessId = b.id
                                     INNER JOIN
                                 tede_flow c ON c.Id = a.FlowId
+                                  INNER JOIN
+                                tede_user d ON d.Id = c.UserId
                             WHERE
                                 a.UserId = {userId}
                                     AND a.Type = '{type}'";
@@ -488,14 +490,9 @@ namespace GxPress.Repository.Implement.WorkFlow
         public async Task<int> GetMyCheckedCountAsync(int userId, string type, bool isDone, FlowListRequest request)
         {
             string sql = $@"
-                        SELECT 
-                                count(1)
-                            FROM
-                                tede_flow
-                            WHERE
-                                Id IN (
+                    
                            SELECT 
-                               a.FlowId
+                              count(1)
                             FROM
                                 tede_flow_todo a
                                     INNER JOIN
@@ -559,7 +556,6 @@ namespace GxPress.Repository.Implement.WorkFlow
                     sql += $" AND b.Id IN ({processId})";
                 }
             }
-            sql += ")";
             var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
             var database = new Database(databaseType, _connectionString);
             var connection = database.GetConnection();
@@ -617,6 +613,8 @@ namespace GxPress.Repository.Implement.WorkFlow
                                 tede_process b ON a.ProcessId = b.id
                                     INNER JOIN
                                 tede_flow c ON c.Id = a.FlowId
+                                 INNER JOIN
+                                tede_user d ON d.Id = c.UserId
                             WHERE
                                 a.UserId = {userId}
                                     AND a.Type = '{type}'";