|
@@ -230,7 +230,7 @@ namespace GxPress.Service.Implement.Topic
|
|
|
{
|
|
|
var topicTypeValue = GxPress.EnumConst.AllTypeConst.Note.GetHashCode();
|
|
|
var sql = $@"SELECT
|
|
|
- a.*,
|
|
|
+ a.Id,a.Title,a.UserId,a.Content,a.CreatedDate,a.IsTopic,c.ParentId,
|
|
|
(SELECT
|
|
|
FolderName
|
|
|
FROM
|
|
@@ -287,7 +287,7 @@ namespace GxPress.Service.Implement.Topic
|
|
|
AND SourceId = a.Id
|
|
|
AND AnalyzeType = 3
|
|
|
LIMIT 0 , 1) AS IsCollect,
|
|
|
- b.Name, b.AvatarUrl
|
|
|
+ b.Name as UserName, b.AvatarUrl
|
|
|
FROM
|
|
|
tede_note a
|
|
|
INNER JOIN
|
|
@@ -299,22 +299,22 @@ namespace GxPress.Service.Implement.Topic
|
|
|
";
|
|
|
if (request.UserId <= 0)
|
|
|
{
|
|
|
- sql += @" AND c.ParentId IN (SELECT
|
|
|
+ sql += $@" AND c.ParentId IN (SELECT
|
|
|
id
|
|
|
FROM
|
|
|
tede_middle
|
|
|
WHERE
|
|
|
- FolderType = 4 AND AttributeValue = 2
|
|
|
+ FolderType = {topicTypeValue} AND AttributeValue = 2
|
|
|
AND RoleId = 1)";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- sql += $@" AND (a.userId={request.UserId} or a.FolderId IN (SELECT
|
|
|
+ sql += $@" AND (a.userId={request.UserId} or c.ParentId IN (SELECT
|
|
|
MiddleId
|
|
|
FROM
|
|
|
tede_folder_user
|
|
|
WHERE
|
|
|
- MiddleId = a.FolderId AND UserId = {request.UserId})
|
|
|
+ MiddleId = c.ParentId AND UserId = {request.UserId})
|
|
|
OR a.UserId IN (SELECT
|
|
|
Id
|
|
|
FROM
|
|
@@ -325,7 +325,7 @@ namespace GxPress.Service.Implement.Topic
|
|
|
FROM
|
|
|
tede_middle
|
|
|
WHERE
|
|
|
- id = a.FolderId) and Id=a.UserId
|
|
|
+ id = c.ParentId) and Id=a.UserId
|
|
|
))";
|
|
|
}
|
|
|
|
|
@@ -404,7 +404,7 @@ namespace GxPress.Service.Implement.Topic
|
|
|
c.FolderType = 4 AND a.IsTopic = 1 and c.IsDelete=0";
|
|
|
if (request.UserId <= 0)
|
|
|
{
|
|
|
- sql += @" AND c.ParentId IN (SELECT
|
|
|
+ sql += $@" AND c.ParentId IN (SELECT
|
|
|
id
|
|
|
FROM
|
|
|
tede_middle
|
|
@@ -414,12 +414,12 @@ namespace GxPress.Service.Implement.Topic
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- sql += $@" AND (a.userId={request.UserId} or a.FolderId IN (SELECT
|
|
|
+ sql += $@" AND (a.userId={request.UserId} or c.ParentId IN (SELECT
|
|
|
MiddleId
|
|
|
FROM
|
|
|
tede_folder_user
|
|
|
WHERE
|
|
|
- MiddleId = a.FolderId AND UserId = {request.UserId})
|
|
|
+ MiddleId = c.ParentId AND UserId = {request.UserId})
|
|
|
OR a.UserId IN (SELECT
|
|
|
Id
|
|
|
FROM
|
|
@@ -430,7 +430,7 @@ namespace GxPress.Service.Implement.Topic
|
|
|
FROM
|
|
|
tede_middle
|
|
|
WHERE
|
|
|
- id = a.FolderId) and Id=a.UserId
|
|
|
+ id = c.ParentId) and Id=a.UserId
|
|
|
))";
|
|
|
}
|
|
|
|