lihao 4 年之前
父節點
當前提交
d9ecf79ba7
共有 1 個文件被更改,包括 14 次插入1 次删除
  1. 14 1
      gx_api/GxPress/Repository/GxPress.Repository.Implement/Group/GroupCategoryRepository.cs

+ 14 - 1
gx_api/GxPress/Repository/GxPress.Repository.Implement/Group/GroupCategoryRepository.cs

@@ -138,7 +138,20 @@ namespace GxPress.Repository.Implement.Group
             var databaseType = _databaseTypestr.ToEnum<DatabaseType>(DatabaseType.MySql);
             var database = new Database(databaseType, _connectionString);
             var connection = database.GetConnection();
-            var result = await connection.QueryAsync<GroupCategoryResult>(sql);
+            var result = new List<GroupCategoryResult>();
+            result.AddRange(await connection.QueryAsync<GroupCategoryResult>(sql));
+            sql = $@"SELECT 
+                        *
+                    FROM
+                        tede_group_piazza
+                    WHERE
+                        id NOT IN (SELECT 
+                                GroupCategroyId
+                            FROM
+                                tede_user_group_category
+                            WHERE
+                                UserId = {userId}) order by Sort desc";
+            result.AddRange(await connection.QueryAsync<GroupCategoryResult>(sql));
             foreach (var item in result)
             {
                 item.ImageUrls = StringUtils.AddDomain(item.ImageUrls);