mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 22:43:25 +08:00
【新增】增加[coreshop-advert]广告组件,对标后台管理功能的广告管理,前端可<coreshop-advert codes="广告位code"></coreshop-advert>来实现在前端任何地方引用广告。
This commit is contained in:
@@ -77,6 +77,8 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#region 获取广告位置信息=============================================================================
|
||||
/// <summary>
|
||||
/// 获取广告位置信息
|
||||
@@ -88,19 +90,15 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
{
|
||||
var jm = new WebApiCallBack();
|
||||
|
||||
var position = await _advertPositionServices.QueryListByClauseAsync(p => p.isEnable && p.code == entity.codes);
|
||||
if (!position.Any())
|
||||
var position = await _advertPositionServices.QueryByClauseAsync(p => p.isEnable && p.code == entity.codes);
|
||||
if (position == null)
|
||||
{
|
||||
jm.msg = "未获取到广告位置信息";
|
||||
return jm;
|
||||
}
|
||||
var ids = position.Select(p => p.id).ToList();
|
||||
var isement = await _advertisementServices.QueryListByClauseAsync(p => ids.Contains(p.positionId));
|
||||
|
||||
Dictionary<string, List<CoreCmsAdvertisement>> list = new Dictionary<string, List<CoreCmsAdvertisement>>();
|
||||
list.Add(entity.codes, isement);
|
||||
|
||||
jm.status = true;
|
||||
jm.data = list;
|
||||
jm.data = await _advertisementServices.QueryListByClauseAsync(p => p.positionId == position.id);
|
||||
|
||||
return jm;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user