Commit 0e405378 authored by 黄奎's avatar 黄奎

页面修改

parent 0c4ae316
......@@ -25,9 +25,9 @@ namespace Mall.Module.TradePavilion
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Commerce_Consult_Extend> GetCommerceConsultPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Commerce_Consult_Extend query)
public List<RB_Commerce_Consult_Extend> GetCommerceConsultListModule(RB_Commerce_Consult_Extend query)
{
return consultRepository.GetCommerceConsultPageListRepository(pageIndex, pageSize, out rowsCount, query);
return consultRepository.GetCommerceConsultListRepository(query);
}
/// <summary>
......
......@@ -30,6 +30,17 @@ namespace Mall.Module.TradePavilion
return commerce_NewsRepository.GetCommerceNewsPageListRepository(pageIndex, pageSize, out rowsCount, query);
}
/// <summary>
/// 获取新闻分页列表
/// </summary>
/// <param name="Top"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Commerce_News_Extend> GetCommerceNewsTopListModule(int Top, RB_Commerce_News_Extend query)
{
return commerce_NewsRepository.GetCommerceNewsTopListRepository(Top, query);
}
/// <summary>
/// 新增修改新闻
/// </summary>
......
......@@ -55,5 +55,50 @@ WHERE 1=1
}
return GetPage<RB_Commerce_News_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取新闻分页列表
/// </summary>
/// <param name="Top"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Commerce_News_Extend> GetCommerceNewsTopListRepository(int Top, RB_Commerce_News_Extend query)
{
DynamicParameters parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM rb_commerce_news AS A
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Commerce_News_Extend.Status), (int)DateStateEnum.Normal);
if (query == null)
{
return new List<RB_Commerce_News_Extend>();
}
else
{
if (query.TenantId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Commerce_News_Extend.TenantId), query.TenantId);
}
if (query.MallBaseId > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Commerce_News_Extend.MallBaseId), query.MallBaseId);
}
if (!string.IsNullOrEmpty(query.Title))
{
builder.AppendFormat(" AND A.{0} LIKE @Name ", nameof(RB_Commerce_News_Extend.Title));
parameters.Add("Name", "%" + query.Title.Trim() + "%");
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Commerce_News_Extend.PublishTime));
if (Top > 0)
{
builder.AppendFormat(" LIMIT {0} ", Top);
}
return Get<RB_Commerce_News_Extend>(builder.ToString(), parameters).ToList();
}
}
}
......@@ -109,13 +109,10 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// <returns></returns>
public ApiResult GetCommerceActivityTypeList()
{
JObject jObj = JObject.Parse(RequestParm.msg.ToString());
var query = new RB_Commerce_ActivityType_Extend()
{
TypeName = jObj.GetStringValue("TypeName")
};
var query = new RB_Commerce_ActivityType_Extend();
var userInfo = AppletUserInfo;
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
query.TenantId = userInfo?.TenantId??0;
var list = activityModule.GetCommerceActivityTypeListModule(query);
return ApiResult.Success(data: list.Select(qitem=>new { qitem.Id,qitem.CoverImage,qitem.TypeName}));
}
......@@ -132,8 +129,9 @@ namespace Mall.WebApi.Controllers.TradePavilion
{
ActivityType= jObj.GetInt("ActivityType")
};
var userInfo = AppletUserInfo;
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
query.TenantId = userInfo?.TenantId ?? 0;
var list = activityModule.GetCommerceActivityPageListModule(pageModel.pageIndex, pageModel.pageSize, out long rowsCount, query);
pageModel.count = Convert.ToInt32(rowsCount);
pageModel.pageData = list;
......@@ -168,14 +166,23 @@ namespace Mall.WebApi.Controllers.TradePavilion
LinkMan = jObj.GetStringValue("LinkMan"),
LinkTel = jObj.GetStringValue("LinkTel"),
};
var userInfo = AppletUserInfo;
extModel.Status = Common.Enum.DateStateEnum.Normal;
extModel.MallBaseId = RequestParm.MallBaseId;
extModel.TenantId = RequestParm.TenantId;
var userInfo = AppletUserInfo;
extModel.TenantId = userInfo?.TenantId ?? 0;
extModel.UserId = userInfo?.UserId??0;
extModel.CreateTime = DateTime.Now;
var flag = consultModule.SetCommerceConsultModule(extModel);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 获取新闻前几条
/// </summary>
/// <returns></returns>
public ApiResult GetNewsTop()
{
return null;
}
}
}
......@@ -334,7 +334,7 @@ namespace Mall.WebApi.Controllers.TradePavilion
};
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
var list = activityModule.GetCommerceActivityPageListModule(pageModel.pageIndex, pageModel.pageSize, out long rowsCount, query);
var list = activityModule.GetCommerceActivityPageListModule(pageModel.pageIndex, pageModel.pageSize, out long rowsCount, query,isQuerySignup:true);
pageModel.count = Convert.ToInt32(rowsCount);
pageModel.pageData = list;
return ApiResult.Success(data: pageModel);
......@@ -499,7 +499,6 @@ namespace Mall.WebApi.Controllers.TradePavilion
/// <returns></returns>
public ApiResult GetCommerceConsultPage()
{
ResultPageModel pageModel = JsonConvert.DeserializeObject<ResultPageModel>(RequestParm.msg.ToString());
JObject jObj = JObject.Parse(RequestParm.msg.ToString());
var query = new RB_Commerce_Consult_Extend()
{
......@@ -507,10 +506,8 @@ namespace Mall.WebApi.Controllers.TradePavilion
};
query.MallBaseId = RequestParm.MallBaseId;
query.TenantId = RequestParm.TenantId;
var list = consultModule.GetCommerceConsultPageListModule(pageModel.pageIndex, pageModel.pageSize, out long rowsCount, query);
pageModel.count = Convert.ToInt32(rowsCount);
pageModel.pageData = list;
return ApiResult.Success(data: pageModel);
var list = consultModule.GetCommerceConsultListModule(query);
return ApiResult.Success(data: list);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment