【新增】WebApi文章Controller新增【获取最新文章】【获取文章栏目】两个接口

This commit is contained in:
大灰灰
2022-11-29 01:19:55 +08:00
parent 30f1082e06
commit 9e5232762a
7 changed files with 157 additions and 17 deletions

View File

@@ -210,11 +210,23 @@ namespace CoreCms.Net.Web.WebApi.Controllers
}
if (!string.IsNullOrWhiteSpace(obj.brandId))
{
var brandId = obj.brandId.ObjectToInt(0);
if (brandId > 0)
if (obj.brandId.Contains(","))
{
where = where.And(p => p.brandId == brandId);
var brandIdsIntArray = CommonHelper.StringToIntArray(obj.brandId);
if (brandIdsIntArray.Any())
{
where = where.And(p => brandIdsIntArray.Contains(p.brandId));
}
}
else
{
var brandId = obj.brandId.ObjectToInt(0);
if (brandId > 0)
{
where = where.And(p => p.brandId == brandId);
}
}
}
if (!string.IsNullOrWhiteSpace(obj.labelId))
{