|
@@ -102,15 +102,16 @@ namespace GxPress.Repository.Implement.Note
|
|
|
public string GetCollectionSql(NoteSearchPageListRequest request)
|
|
|
{
|
|
|
string sql = "";
|
|
|
+ var noteTypeId= GxPress.EnumConst.AllTypeConst.Note.GetHashCode();
|
|
|
if (request.VisitUserId > 0)
|
|
|
{
|
|
|
sql =
|
|
|
- $@"SELECT a.*,(SELECT GROUP_CONCAT(SourceName Separator'、') from tede_user_middle where MiddleType=4 and DataSourceId=a.MiddleSonId) as EnjoyUser,(SELECT
|
|
|
+ $@"SELECT a.*,(SELECT GROUP_CONCAT(SourceName Separator'、') from tede_user_middle where MiddleType={noteTypeId} and DataSourceId=a.MiddleSonId) as EnjoyUser,(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
tede_analyze
|
|
|
WHERE
|
|
|
- UserId = {request.UserId} AND TypeValue = 3
|
|
|
+ UserId = {request.UserId} AND TypeValue ={noteTypeId}
|
|
|
AND SourceId = a.MiddleId
|
|
|
AND AnalyzeType = 1) AS PraiseCount,
|
|
|
(SELECT
|
|
@@ -118,7 +119,7 @@ namespace GxPress.Repository.Implement.Note
|
|
|
FROM
|
|
|
tede_analyze
|
|
|
WHERE
|
|
|
- UserId = {request.UserId} AND TypeValue = 3
|
|
|
+ UserId = {request.UserId} AND TypeValue ={noteTypeId}
|
|
|
AND SourceId = a.MiddleId
|
|
|
AND AnalyzeType = 1
|
|
|
LIMIT 0 , 1) AS IsPraise,
|
|
@@ -128,13 +129,13 @@ namespace GxPress.Repository.Implement.Note
|
|
|
tede_comment
|
|
|
WHERE
|
|
|
ArticleId = a.MiddleId and pid=0
|
|
|
- AND TypeValue = 3) AS CommentCount,
|
|
|
+ AND TypeValue = {noteTypeId}) AS CommentCount,
|
|
|
(SELECT
|
|
|
COUNT(1)
|
|
|
FROM
|
|
|
tede_analyze
|
|
|
WHERE
|
|
|
- UserId = {request.UserId} AND TypeValue = 3
|
|
|
+ UserId = {request.UserId} AND TypeValue ={noteTypeId}
|
|
|
AND SourceId = a.MiddleId
|
|
|
AND AnalyzeType = 4) AS RetransmissionCount,
|
|
|
(SELECT
|
|
@@ -142,7 +143,7 @@ namespace GxPress.Repository.Implement.Note
|
|
|
FROM
|
|
|
tede_analyze
|
|
|
WHERE
|
|
|
- UserId = {request.UserId} AND TypeValue = 3
|
|
|
+ UserId = {request.UserId} AND TypeValue = {noteTypeId}
|
|
|
AND SourceId = a.MiddleId
|
|
|
AND AnalyzeType = 4
|
|
|
LIMIT 0 , 1) AS IsRetransmission,
|
|
@@ -151,7 +152,7 @@ namespace GxPress.Repository.Implement.Note
|
|
|
FROM
|
|
|
tede_analyze
|
|
|
WHERE
|
|
|
- UserId = {request.UserId} AND TypeValue = 3
|
|
|
+ UserId = {request.UserId} AND TypeValue = {noteTypeId}
|
|
|
AND SourceId = a.MiddleId
|
|
|
AND AnalyzeType = 4
|
|
|
LIMIT 0 , 1) AS IsCollect,
|
|
@@ -160,7 +161,7 @@ namespace GxPress.Repository.Implement.Note
|
|
|
FROM
|
|
|
tede_analyze
|
|
|
WHERE
|
|
|
- UserId = {request.UserId} AND TypeValue = 3
|
|
|
+ UserId = {request.UserId} AND TypeValue = {noteTypeId}
|
|
|
AND SourceId = a.MiddleId
|
|
|
AND AnalyzeType = 4) AS CollectCount,
|
|
|
(SELECT
|