|
@@ -444,6 +444,7 @@ namespace GxPress.Repository.Implement
|
|
|
|
|
|
public async Task<PagedList<TopicListPageResult>> GetTopicByGroupAsync(TopicPageSearchRequest request)
|
|
|
{
|
|
|
+ var topicConstValue=AllTypeConst.Topic.GetHashCode();
|
|
|
var sql = $@"SELECT
|
|
|
a.*,
|
|
|
(SELECT
|
|
@@ -451,14 +452,14 @@ namespace GxPress.Repository.Implement
|
|
|
FROM
|
|
|
tede_analyze
|
|
|
WHERE
|
|
|
- TypeValue = 3 AND SourceId = a.Id
|
|
|
+ TypeValue ={topicConstValue} AND SourceId = a.Id
|
|
|
AND AnalyzeType = 1) AS PraiseCount,
|
|
|
(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
tede_analyze
|
|
|
WHERE
|
|
|
- UserId = {request.UserId} AND TypeValue = 3
|
|
|
+ UserId = {request.UserId} AND TypeValue = {topicConstValue}
|
|
|
AND SourceId = a.Id
|
|
|
AND AnalyzeType = 1
|
|
|
LIMIT 0 , 1) AS IsPraise,
|
|
@@ -467,14 +468,14 @@ namespace GxPress.Repository.Implement
|
|
|
FROM
|
|
|
tede_comment
|
|
|
WHERE
|
|
|
- ArticleId = a.Id AND TypeValue = 3
|
|
|
+ ArticleId = a.Id AND TypeValue = {topicConstValue}
|
|
|
AND Pid = 0) AS CommentCount,
|
|
|
(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
tede_analyze
|
|
|
WHERE
|
|
|
- UserId = {request.UserId} AND TypeValue = 3
|
|
|
+ UserId = {request.UserId} AND TypeValue = {topicConstValue}
|
|
|
AND SourceId = a.Id
|
|
|
AND AnalyzeType = 4) AS RetransmissionCount,
|
|
|
(SELECT
|
|
@@ -482,7 +483,7 @@ namespace GxPress.Repository.Implement
|
|
|
FROM
|
|
|
tede_analyze
|
|
|
WHERE
|
|
|
- UserId = {request.UserId} AND TypeValue = 3
|
|
|
+ UserId = {request.UserId} AND TypeValue = {topicConstValue}
|
|
|
AND SourceId = a.Id
|
|
|
AND AnalyzeType = 4
|
|
|
LIMIT 0 , 1) AS IsRetransmission,
|
|
@@ -491,7 +492,7 @@ namespace GxPress.Repository.Implement
|
|
|
FROM
|
|
|
tede_analyze
|
|
|
WHERE
|
|
|
- UserId = {request.UserId} AND TypeValue = 3
|
|
|
+ UserId = {request.UserId} AND TypeValue = {topicConstValue}
|
|
|
AND SourceId = a.Id
|
|
|
AND AnalyzeType = 3
|
|
|
LIMIT 0 , 1) AS IsCollect,
|