mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2025-12-06 20:03:26 +08:00
【新增】后台分销商列表,增加申请分销的用户等级展示及等级筛选功能。
This commit is contained in:
@@ -117,6 +117,87 @@ namespace CoreCms.Net.Repository
|
||||
#endregion
|
||||
|
||||
|
||||
#region 重写根据条件查询分页数据
|
||||
/// <summary>
|
||||
/// 重写根据条件查询分页数据
|
||||
/// </summary>
|
||||
/// <param name="predicate">判断集合</param>
|
||||
/// <param name="orderByType">排序方式</param>
|
||||
/// <param name="pageIndex">当前页面索引</param>
|
||||
/// <param name="pageSize">分布大小</param>
|
||||
/// <param name="orderByExpression"></param>
|
||||
/// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param>
|
||||
/// <returns></returns>
|
||||
public new async Task<IPageList<CoreCmsDistribution>> QueryPageAsync(Expression<Func<CoreCmsDistribution, bool>> predicate,
|
||||
Expression<Func<CoreCmsDistribution, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1,
|
||||
int pageSize = 20, bool blUseNoLock = false)
|
||||
{
|
||||
RefAsync<int> totalCount = 0;
|
||||
List<CoreCmsDistribution> page;
|
||||
if (blUseNoLock)
|
||||
{
|
||||
page = await DbClient.Queryable<CoreCmsDistribution>()
|
||||
.Select(p => new CoreCmsDistribution
|
||||
{
|
||||
id = p.id,
|
||||
userId = p.userId,
|
||||
name = p.name,
|
||||
gradeId = p.gradeId,
|
||||
mobile = p.mobile,
|
||||
weixin = p.weixin,
|
||||
qq = p.qq,
|
||||
storeName = p.storeName,
|
||||
storeLogo = p.storeLogo,
|
||||
storeBanner = p.storeBanner,
|
||||
storeDesc = p.storeDesc,
|
||||
verifyStatus = p.verifyStatus,
|
||||
createTime = p.createTime,
|
||||
updateTime = p.updateTime,
|
||||
verifyTime = p.verifyTime,
|
||||
isDelete = p.isDelete,
|
||||
UserGradeId = SqlFunc.Subqueryable<CoreCmsUser>().Where(o => o.id == p.userId).Select(p => p.grade)
|
||||
|
||||
})
|
||||
.MergeTable()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate)
|
||||
.With(SqlWith.NoLock).ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
page = await DbClient.Queryable<CoreCmsDistribution>()
|
||||
.Select(p => new CoreCmsDistribution
|
||||
{
|
||||
id = p.id,
|
||||
userId = p.userId,
|
||||
name = p.name,
|
||||
gradeId = p.gradeId,
|
||||
mobile = p.mobile,
|
||||
weixin = p.weixin,
|
||||
qq = p.qq,
|
||||
storeName = p.storeName,
|
||||
storeLogo = p.storeLogo,
|
||||
storeBanner = p.storeBanner,
|
||||
storeDesc = p.storeDesc,
|
||||
verifyStatus = p.verifyStatus,
|
||||
createTime = p.createTime,
|
||||
updateTime = p.updateTime,
|
||||
verifyTime = p.verifyTime,
|
||||
isDelete = p.isDelete,
|
||||
UserGradeId = SqlFunc.Subqueryable<CoreCmsUser>().Where(o => o.id == p.userId).Select(p => p.grade)
|
||||
})
|
||||
.MergeTable()
|
||||
.OrderByIF(orderByExpression != null, orderByExpression, orderByType)
|
||||
.WhereIF(predicate != null, predicate)
|
||||
.ToPageListAsync(pageIndex, pageSize, totalCount);
|
||||
}
|
||||
var list = new PageList<CoreCmsDistribution>(page, pageIndex, pageSize, totalCount);
|
||||
return list;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user