Commit 26f1d32e authored by liudong1993's avatar liudong1993

1

parent b8debc32
...@@ -55,29 +55,31 @@ namespace Mall.Repository.Point ...@@ -55,29 +55,31 @@ namespace Mall.Repository.Point
public List<RB_Member_PointBalance_Extend> GetPointBalancePageList(int pageIndex, int pageSize, out long rowsCount, RB_Member_PointBalance_Extend where) public List<RB_Member_PointBalance_Extend> GetPointBalancePageList(int pageIndex, int pageSize, out long rowsCount, RB_Member_PointBalance_Extend where)
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.Append($@"SELECT * from RB_Member_PointBalance where 1=1 "); sb.Append($@"SELECT b.*,u.Name as UserName,u.Photo as UserPhoto from RB_Member_PointBalance b
left join rb_member_user u on b.UserId = u.Id
where 1=1 ");
if (where != null) if (where != null)
{ {
if (where.TenantId > 0) if (where.TenantId > 0)
{ {
sb.AppendFormat(" and TenantId={0}", where.TenantId); sb.AppendFormat(" and b.TenantId={0}", where.TenantId);
} }
if (where.MallBaseId > 0) if (where.MallBaseId > 0)
{ {
sb.AppendFormat(" and MallBaseId={0}", where.MallBaseId); sb.AppendFormat(" and b.MallBaseId={0}", where.MallBaseId);
} }
if (where.UserId > 0) if (where.UserId > 0)
{ {
sb.AppendFormat(" and UserId={0}", where.UserId); sb.AppendFormat(" and b.UserId={0}", where.UserId);
} }
if (where.Type > 0) { if (where.Type > 0) {
sb.AppendFormat(" and Type ={0}", (int)where.Type); sb.AppendFormat(" and b.Type ={0}", (int)where.Type);
} }
if (where.OrderId > 0) { if (where.OrderId > 0) {
sb.AppendFormat(" and OrderId ={0}", where.OrderId); sb.AppendFormat(" and b.OrderId ={0}", where.OrderId);
} }
} }
sb.Append($@" order by Id desc"); sb.Append($@" order by b.Id desc");
return GetPage<RB_Member_PointBalance_Extend>(pageIndex, pageSize, out rowsCount, sb.ToString()).ToList(); return GetPage<RB_Member_PointBalance_Extend>(pageIndex, pageSize, out rowsCount, sb.ToString()).ToList();
} }
} }
......
...@@ -168,12 +168,6 @@ namespace Mall.WebApi.Controllers.Education ...@@ -168,12 +168,6 @@ namespace Mall.WebApi.Controllers.Education
demodel.MallBaseId = userInfo.MallBaseId; demodel.MallBaseId = userInfo.MallBaseId;
var list = pointModule.GetUserPointDetailPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel); var list = pointModule.GetUserPointDetailPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
pagelist.count = Convert.ToInt32(count); pagelist.count = Convert.ToInt32(count);
list.ForEach(x =>
{
var umodel = UserReidsCache.GetAppletUserLoginInfo(x.UserId);
x.UserName = umodel?.Name ?? "";
x.UserPhoto = umodel?.Photo ?? "";
});
pagelist.pageData = list.Select(x => new pagelist.pageData = list.Select(x => new
{ {
x.Id, x.Id,
...@@ -185,7 +179,8 @@ namespace Mall.WebApi.Controllers.Education ...@@ -185,7 +179,8 @@ namespace Mall.WebApi.Controllers.Education
CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "", CreateDate = x.CreateDate.HasValue ? x.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss") : "",
x.UserId, x.UserId,
x.UserName, x.UserName,
x.UserPhoto x.UserPhoto,
x.OrderId
}); });
return ApiResult.Success("", pagelist); return ApiResult.Success("", pagelist);
} }
......
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