Commit 5bf7c754 authored by liudong1993's avatar liudong1993
parents b4299caf 38130ae7
......@@ -3420,6 +3420,16 @@ namespace Mall.Module.User
};
}
/// <summary>
/// 获取用户列表
/// </summary>
/// <param name="dmodel"></param>
/// <returns></returns>
public List<RB_Member_User_Extend> GetUserListExtModule(RB_Member_User_Extend dmodel)
{
return member_UserRepository.GetListExtRepository(dmodel);
}
/// <summary>
/// 获取团队成员详情
/// </summary>
......@@ -3427,7 +3437,7 @@ namespace Mall.Module.User
/// <returns></returns>
public object GetTeamUserInfoModule(int UserId)
{
var extModel = member_UserRepository.GetListExtRepository(new RB_Member_User_Extend() { UserIds = UserId.ToString() })?.FirstOrDefault();
var extModel = GetUserListExtModule(new RB_Member_User_Extend() { UserIds = UserId.ToString() })?.FirstOrDefault();
List<RB_Member_User_Extend> totalList = new List<RB_Member_User_Extend>();
//本月佣金
List<RB_Member_User_Extend> currentMonthList = new List<RB_Member_User_Extend>();
......
......@@ -436,12 +436,12 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
//销量高=>低【降序】
else if (dmodel.OrderBy == 4)
{
orderBy = $" order by g.{nameof(RB_Goods_Extend.SalesNum)} DESC ";
orderBy = $" order by (g.SalesNum+IFNULL(tempOrder.OrderNum,0)) DESC ";
}
//销量低=>高【升序】
else if (dmodel.OrderBy == 6)
{
orderBy = $" order by g.{nameof(RB_Goods_Extend.SalesNum)} ASC ";
orderBy = $" order by (g.SalesNum+IFNULL(tempOrder.OrderNum,0)) ASC ";
}
//综合【降序】
else if (dmodel.OrderBy == 7)
......@@ -467,9 +467,15 @@ WHERE {where} group by g.Id order by g.CreateDate desc";
}
}
string sql = $@"select g.* from RB_Goods g
inner join rb_goods_category c on g.Id=c.GoodsId
where {where} group by g.Id {orderBy}";
string sql = $@"
SELECT g.*
FROM RB_Goods g INNER JOIN rb_goods_category c on g.Id=c.GoodsId
LEFT JOIN (
SELECT od.GoodsId ,SUM(od.Number) as OrderNum FROM rb_goods_order o
INNER JOIN rb_goods_orderdetail od on o.OrderId=od.OrderId
WHERE 1=1 and o.`Status`=0 and o.OrderStatus <> 7 group by od.GoodsId
) AS tempOrder ON g.Id=tempOrder.GoodsId
WHERE {where} group by g.Id {orderBy}";
return GetPage<RB_Goods_Extend>(pageIndex, pageSize, out count, sql).ToList();
}
......
......@@ -1713,7 +1713,16 @@ namespace Mall.WebApi.Controllers.User
{
demodel.UserId = parms.GetInt("NewUserId");
}
List<RB_Member_User_Extend> memberList = new List<RB_Member_User_Extend>();
var list = userModule.GetOrderIntroductionPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
if (list != null && list.Count > 0)
{
var userIds = string.Join(",",list.Select(qitem => qitem.UserId));
if (!string.IsNullOrWhiteSpace(userIds))
{
memberList= userModule.GetUserListExtModule(new RB_Member_User_Extend() { UserIds = userIds });
}
}
pagelist.count = Convert.ToInt32(count);
pagelist.pageData = list.Select(x => new
{
......@@ -1732,6 +1741,7 @@ namespace Mall.WebApi.Controllers.User
y.Number
}),
x.UserId,
Icon= memberList?.Where(qitem=>qitem.Id==x.UserId)?.FirstOrDefault()?.Icon??"",
x.UserName,
x.Photo,
x.Mobile,
......
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