mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 22:43:25 +08:00
【新增】优化广告组件,表【CoreCmsAdvertPosition】新增【platform】广告平台字段,【type】广告位类型两个字段,用于区分pc,h5,小程序多端,以及图片还是轮播图展示形式。
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user