分页统计排序错误! 返回
SqlSugar
沟通中
2
327
悬赏:0 飞吻
var timer_list = db.Queryable<iCore.Model.Timer>().Where(exp.ToExpression()).Select(it => new iCore.Model.Timer
{
ID = it.ID.selectAll(),
CreateTime = it.CreateTime,
vThisCount = SqlFunc.DateDiff(DateType.Second, it.StartTime, DateTime.Now),
vUseTimeCount = SqlFunc.Subqueryable<iCore.Model.TimerLog>().Where(s => s.ShopID == it.ShopID && s.TimerID == it.ID).Sum(s => s.UseTimeCount)
}).OrderBy(it=>it.CreateTime, OrderByType.Desc).ToPageList(pageIndex, pageSize, ref totalCount);vUseTimeCount = SqlFunc.Subqueryable<iCore.Model.TimerLog>().Where(s => s.ShopID == it.ShopID && s.TimerID == it.ID).Sum(s => s.UseTimeCount)
加上这句,排序就不正常。不管怎么排都是正序,为什么?
热忱回答(2)
-
fate sta VIP0
2025/12/1用 tooffsetpage 分页
0 回复 -
阿牧 VIP0
2025/12/1有对应的文档吗?或者例子?
0 回复