| | |
| | | using CoreCms.Net.Model.ViewModels.UI; |
| | | using SqlSugar; |
| | | using CoreCms.Net.Model.Entities.Order; |
| | | using CoreCms.Net.Model.Entities.baifenbingfa.puhuo; |
| | | |
| | | namespace CoreCms.Net.Repository |
| | | { |
| | |
| | | /// <param name="blUseNoLock">是否使用WITH(NOLOCK)</param> |
| | | /// <returns></returns> |
| | | public async Task<IPageList<CoreCmsPlanOrder>> QueryPageAsync(Expression<Func<CoreCmsPlanOrder, bool>> predicate, |
| | | Expression<Func<CoreCmsPlanOrder, object>> orderByExpression, OrderByType orderByType, int pageIndex = 1, |
| | | Expression<Func<CoreCmsPlanOrder, object>> orderByExpression, OrderByType orderByType, OtherData otherData, int pageIndex = 1, |
| | | int pageSize = 20, bool blUseNoLock = false) |
| | | { |
| | | RefAsync<int> totalCount = 0; |
| | |
| | | pianqu = p.pianqu, |
| | | shouhuoAddress = p.shouhuoAddress, |
| | | |
| | | |
| | | }).ToPageListAsync(pageIndex, pageSize, totalCount); |
| | | } |
| | | |
| | | |
| | | |
| | | var pagetotal = DbClient.Queryable<CoreCmsPlanOrder>() |
| | | // .GroupBy(it => new { it.CategoryId, it.CategoryName, it.goodsId, it.goodsName, it.productsId, it.productsName, it.price }) |
| | | .WhereIF(predicate != null, predicate) |
| | | .Select(p => new CoreCmsPlanOrder |
| | | { |
| | | oldOrderAmounts = SqlFunc.AggregateSum(p.oldOrderAmount), |
| | | orderAmounts = SqlFunc.AggregateSum(p.orderAmount), |
| | | keYongAmounts = SqlFunc.AggregateSum(p.keYongAmount), |
| | | }) |
| | | .First(); // 或者使用 Single/FirstOrDefault 等方法获取结果 |
| | | |
| | | otherData.heji4 = pagetotal.oldOrderAmounts; |
| | | otherData.heji5 = pagetotal.orderAmounts; |
| | | otherData.heji6 = pagetotal.keYongAmounts; |
| | | |
| | | var list = new PageList<CoreCmsPlanOrder>(page, pageIndex, pageSize, totalCount); |
| | | return list; |
| | | } |