|
@@ -294,9 +294,22 @@ namespace GxPress.Service.Implement.Topic
|
|
|
tede_user b ON a.UserId = b.Id
|
|
|
INNER JOIN
|
|
|
tede_middle c ON c.MiddleId = a.Id
|
|
|
- WHERE
|
|
|
- c.FolderType = {topicTypeValue} AND a.IsTopic = 1
|
|
|
- AND (a.FolderId IN (SELECT
|
|
|
+ WHERE
|
|
|
+ c.FolderType = {topicTypeValue} AND a.IsTopic = 1 and c.IsDelete=0
|
|
|
+ ";
|
|
|
+ if (request.UserId <= 0)
|
|
|
+ {
|
|
|
+ sql += @" AND c.ParentId IN (SELECT
|
|
|
+ id
|
|
|
+ FROM
|
|
|
+ tede_middle
|
|
|
+ WHERE
|
|
|
+ FolderType = 4 AND AttributeValue = 2
|
|
|
+ AND RoleId = 1)";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sql += $@" AND (a.FolderId IN (SELECT
|
|
|
MiddleId
|
|
|
FROM
|
|
|
tede_folder_user
|
|
@@ -313,7 +326,8 @@ namespace GxPress.Service.Implement.Topic
|
|
|
tede_middle
|
|
|
WHERE
|
|
|
id = a.FolderId) and Id=a.UserId
|
|
|
- )) and c.IsDelete=0";
|
|
|
+ ))";
|
|
|
+ }
|
|
|
|
|
|
if (request.TopicGroupIds.Count > 0)
|
|
|
{
|
|
@@ -387,8 +401,20 @@ namespace GxPress.Service.Implement.Topic
|
|
|
INNER JOIN
|
|
|
tede_middle c ON c.MiddleId = a.Id
|
|
|
WHERE
|
|
|
- c.FolderType = 4 AND a.IsTopic = 1
|
|
|
- AND (a.FolderId IN (SELECT
|
|
|
+ c.FolderType = 4 AND a.IsTopic = 1 and c.IsDelete=0";
|
|
|
+ if (request.UserId <= 0)
|
|
|
+ {
|
|
|
+ sql += @" AND c.ParentId IN (SELECT
|
|
|
+ id
|
|
|
+ FROM
|
|
|
+ tede_middle
|
|
|
+ WHERE
|
|
|
+ FolderType = 4 AND AttributeValue = 2
|
|
|
+ AND RoleId = 1)";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sql += $@" AND (a.FolderId IN (SELECT
|
|
|
MiddleId
|
|
|
FROM
|
|
|
tede_folder_user
|
|
@@ -404,8 +430,9 @@ namespace GxPress.Service.Implement.Topic
|
|
|
FROM
|
|
|
tede_middle
|
|
|
WHERE
|
|
|
- id = a.FolderId)
|
|
|
- AND id = a.UserId)) and c.IsDelete=0";
|
|
|
+ id = a.FolderId) and Id=a.UserId
|
|
|
+ ))";
|
|
|
+ }
|
|
|
|
|
|
if (request.TopicGroupIds.Count > 0)
|
|
|
{
|