feat: 优化主题置顶显示,同时添加模板

This commit is contained in:
陈淳
2024-01-10 09:12:30 +08:00
parent 8c122b7e09
commit 2b870358e9
3 changed files with 25 additions and 5 deletions

View File

@@ -0,0 +1,23 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "ccnetcore",
"classifications": [ "Common", "Code" ],
"identity": "yi",
"name": "YI",
"shortName": "yi",
"sourceName": "Yi.Abp",
"tags": {
"language": "C#",
"type": "item"
},
"sources": [
{
"modifiers": [
{
"exclude": [ "bin/**/*", "obj/**/*", "*.user", "*.vspscc", "*.vssscc", "*.cache",".git/**/*",".vs/**/*" ]
}
]
}
]
}

View File

@@ -10,7 +10,7 @@ namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Discuss
public Guid? PlateId { get; set; }
//Ĭ<>ϲ<EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD>ö<EFBFBD>
public bool IsTop { get; set; } = false;
public bool? IsTop { get; set; }
//<2F><>ѯ<EFBFBD><D1AF>ʽ

View File

@@ -106,10 +106,7 @@ namespace Yi.Framework.Bbs.Application.Services
var items = await _forumManager._discussRepository._DbQueryable
.WhereIF(!string.IsNullOrEmpty(input.Title), x => x.Title.Contains(input.Title))
.WhereIF(input.PlateId is not null, x => x.PlateId == input.PlateId)
.WhereIF(input.IsTop == true, x => x.IsTop == input.IsTop)
.WhereIF(input.IsTop is not null,x=>x.IsTop==input.IsTop)
.LeftJoin<UserEntity>((discuss, user) => discuss.CreatorId == user.Id)
.LeftJoin<BbsUserExtraInfoEntity>((discuss, user, info) => user.Id == info.UserId)