【新增】优化广告组件,表【CoreCmsAdvertPosition】新增【platform】广告平台字段,【type】广告位类型两个字段,用于区分pc,h5,小程序多端,以及图片还是轮播图展示形式。

This commit is contained in:
JianWeie
2023-01-10 16:04:48 +08:00
parent 3d8a3436a3
commit 8632c6fb26
21 changed files with 379 additions and 80 deletions

View File

@@ -77,8 +77,6 @@ namespace CoreCms.Net.Web.WebApi.Controllers
}
#endregion
#region 广=============================================================================
/// <summary>
/// 获取广告位置信息
@@ -90,7 +88,7 @@ namespace CoreCms.Net.Web.WebApi.Controllers
{
var jm = new WebApiCallBack();
var position = await _advertPositionServices.QueryByClauseAsync(p => p.isEnable && p.code == entity.codes);
var position = await _advertPositionServices.QueryByClauseAsync(p => p.isEnable && p.code == entity.code && p.platform == entity.platform);
if (position == null)
{
jm.msg = "未获取到广告位置信息";
@@ -98,13 +96,15 @@ namespace CoreCms.Net.Web.WebApi.Controllers
}
jm.status = true;
jm.data = await _advertisementServices.QueryListByClauseAsync(p => p.positionId == position.id);
jm.data = new
{
position,
childs = await _advertisementServices.QueryListByClauseAsync(p => p.positionId == position.id, p => p.sort, OrderByType.Desc, true)
};
return jm;
}
#endregion
}
}