Commit 17ae9c92 authored by 黄奎's avatar 黄奎

页面修改

parent 8b1e407e
......@@ -96,8 +96,9 @@ namespace Mall.Module.MarketingCenter
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowsCount">总条数</param>
/// <param name="query">查询条件</param>
/// <param name="IsUse">true-只查询启用的</param>
/// <returns></returns>
public List<RB_Share_Friend_Extend> GetShareFriendPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Share_Friend_Extend query)
public List<RB_Share_Friend_Extend> GetShareFriendPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Share_Friend_Extend query, bool IsUse = false)
{
var cateAllList = share_CategoryRepository.GetShareCategoryListRepository(new RB_Share_Category_Extend()
{
......@@ -110,7 +111,7 @@ namespace Mall.Module.MarketingCenter
query.CateId = 0;
query.CateIds = string.Join(",", cateList.Select(qitem => qitem.Id));
}
var list = share_FriendRepository.GetShareFriendPageListRepository(pageIndex, pageSize, out rowsCount, query);
var list = share_FriendRepository.GetShareFriendPageListRepository(pageIndex, pageSize, out rowsCount, query, IsUse: IsUse);
foreach (var item in list)
{
item.CateList = GetFatherList(cateAllList, item.CateId).OrderBy(qitem => qitem.Level).ToList();
......
......@@ -20,8 +20,9 @@ namespace Mall.Repository.MarketingCenter
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowsCount">总条数</param>
/// <param name="query">查询条件</param>
/// <param name="IsUse">true-只查询启用的</param>
/// <returns></returns>
public List<RB_Share_Friend_Extend> GetShareFriendPageListRepository(int pageIndex, int pageSize, out long rowsCount, RB_Share_Friend_Extend query)
public List<RB_Share_Friend_Extend> GetShareFriendPageListRepository(int pageIndex, int pageSize, out long rowsCount, RB_Share_Friend_Extend query,bool IsUse=false)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
......@@ -29,6 +30,10 @@ SELECT A.*,B.Name AS GoodsName
FROM rb_share_friend AS A LEFT JOIN rb_goods AS B ON A.GoodsId=B.Id
WHERE 1=1 AND A.Status=0
");
if (IsUse)
{
builder.AppendFormat(" AND A.{0}=1 ", nameof(RB_Share_Friend_Extend.IsUse));
}
if (query != null)
{
if (query.TenantId > 0)
......
......@@ -7,6 +7,7 @@ using Mall.Common.Plugin;
using Mall.Model.Extend.MarketingCenter;
using Mall.Module.MarketingCenter;
using Mall.WebApi.Filter;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
......@@ -47,10 +48,11 @@ namespace Mall.WebApi.Controllers.MarketingCenter
/// 获取分享分类列表
/// </summary>
/// <returns></returns>
[AllowAnonymous]
public ApiResult GetShareCategoryList()
{
var query = JsonConvert.DeserializeObject<RB_Share_Category_Extend>(RequestParm.msg.ToString());
query.TenantId = UserInfo.TenantId;
query.TenantId = RequestParm.TenantId;
query.MallBaseId = RequestParm.MallBaseId;
var list = shareModule.GetShareCategoryListModule(query);
return ApiResult.Success("", list);
......@@ -111,6 +113,7 @@ namespace Mall.WebApi.Controllers.MarketingCenter
/// 获取分享详情分页列表
/// </summary>
/// <returns></returns>
[AllowAnonymous]
public ApiResult GetShareFriendPageList()
{
var parms = RequestParm;
......@@ -124,6 +127,24 @@ namespace Mall.WebApi.Controllers.MarketingCenter
return ApiResult.Success("", pagelist);
}
/// <summary>
/// 小程序获取分享分页列表
/// </summary>
/// <returns></returns>
[AllowAnonymous]
public ApiResult AppGetShareFriendPage()
{
var parms = RequestParm;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(RequestParm.msg.ToString());
var query = JsonConvert.DeserializeObject<RB_Share_Friend_Extend>(RequestParm.msg.ToString());
query.TenantId = parms.TenantId;
query.MallBaseId = parms.MallBaseId;
var list = shareModule.GetShareFriendPageListModule(pagelist.pageIndex, pagelist.pageSize, out long count, query, IsUse: true);
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list;
return ApiResult.Success("", pagelist);
}
/// <summary>
/// 获取分享详情列表
/// </summary>
......@@ -235,6 +256,5 @@ namespace Mall.WebApi.Controllers.MarketingCenter
bool flag = shareModule.SetShareFriendMaterialInfoModule(Id, MaterialInfo);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
}
}
\ No newline at end of file
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