【新增】后台分销商列表,增加申请分销的用户等级展示及等级筛选功能。

This commit is contained in:
大灰灰
2022-08-03 00:19:52 +08:00
parent c648dd3aad
commit a90e20c1e2
7 changed files with 187 additions and 7 deletions

View File

@@ -11,6 +11,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using CoreCms.Net.Configuration;
using CoreCms.Net.IRepository;
@@ -19,12 +20,13 @@ using CoreCms.Net.IServices;
using CoreCms.Net.Loging;
using CoreCms.Net.Model.Entities;
using CoreCms.Net.Model.ViewModels.Basics;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Model.ViewModels.DTO;
using CoreCms.Net.Model.ViewModels.DTO.Distribution;
using CoreCms.Net.Model.ViewModels.UI;
using CoreCms.Net.Utility.Extensions;
using CoreCms.Net.Utility.Helper;
using Newtonsoft.Json.Linq;
using SqlSugar;
namespace CoreCms.Net.Services
@@ -93,6 +95,7 @@ namespace CoreCms.Net.Services
//本月第一天时间
DateTime dtFirst = dt.AddDays(1 - (dt.Day));
dtFirst = new DateTime(dtFirst.Year, dtFirst.Month, dtFirst.Day, 0, 0, 0);
//获得某年某月的天数
int year = dt.Year;
int month = dt.Month;
@@ -510,7 +513,7 @@ namespace CoreCms.Net.Services
var jm = new AdminUiCallBack();
var info = await _dal.QueryByClauseAsync(p => p.userId == userId);
if (info != null && info.gradeId > 0)
if (info is { gradeId: > 0 })
{
//找下有没有可以升级的分销商等级
var grade = await _distributionGradeRepository.QueryByClauseAsync(p => p.id > info.gradeId && p.isAutoUpGrade == true);
@@ -554,5 +557,26 @@ namespace CoreCms.Net.Services
return await _dal.QueryRankingPageAsync(pageIndex, pageSize);
}
#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)
{
return await _dal.QueryPageAsync(predicate, orderByExpression, orderByType, pageIndex, pageSize, blUseNoLock);
}
#endregion
}
}