mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 18:43:26 +08:00
【优化】移除后台会员列表分页联表中的childNum赋值,调整为接口端直接查询
This commit is contained in:
@@ -133,7 +133,7 @@ namespace CoreCms.Net.Repository
|
||||
isDelete = p.isDelete,
|
||||
type = (int)sWeChatInfo.type,
|
||||
parentNickName = sParentUser.nickName,
|
||||
childNum = SqlFunc.Subqueryable<CoreCmsUser>().Where(o => o.parentId == p.id).Count(),
|
||||
//childNum = SqlFunc.Subqueryable<CoreCmsUser>().Where(o => o.parentId == p.id).Count(), //影响效率,移除掉。放到接口端单独计算。
|
||||
})
|
||||
.MergeTable().With(SqlWith.Null)
|
||||
.OrderBy(orderByExpression, orderByType)
|
||||
|
||||
@@ -2082,13 +2082,13 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
||||
var data = await _userServices.QueryPageAsync(where, p => p.createTime, OrderByType.Desc, entity.page, entity.limit);
|
||||
|
||||
jm.status = true;
|
||||
jm.data = data.Select(p => new
|
||||
jm.data = data.Select(async p => new
|
||||
{
|
||||
p.nickName,
|
||||
p.avatarImage,
|
||||
mobile = UserHelper.FormatMobile(p.mobile),
|
||||
p.createTime,
|
||||
p.childNum
|
||||
childNum = await _userServices.GetCountAsync(p => p.parentId == p.id)
|
||||
});
|
||||
jm.otherData = new
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user