fix 查询问题
This commit is contained in:
@@ -48,14 +48,14 @@ public class SysDataService : ISysDataService
|
||||
case "GainfoMeal":
|
||||
{
|
||||
var r = await _dbContext.Queryable<GainfoEntity>()
|
||||
.LeftJoin<BalanceRecordEntity>((x, b) => x.Code == b.UserCode)
|
||||
.Where(x => x.Factory == factory)
|
||||
.Where((x, b) => b.Source != BalanceRecordSourceEnumType.EMealVoucher && b.Status == BalanceRecordStatusEnumType.Valid && b.IsDeleted == false)
|
||||
.GroupBy(x => x.Code)
|
||||
.Select((x, b) => new
|
||||
.Select(x => new
|
||||
{
|
||||
UserCode = x.Code,
|
||||
Balance = SqlFunc.AggregateSum(b.Amount)
|
||||
Balance = SqlFunc.Subqueryable<BalanceRecordEntity>().Where(p => p.UserCode == x.Code)
|
||||
.Where(p => p.Source != BalanceRecordSourceEnumType.EMealVoucher && p.Status == BalanceRecordStatusEnumType.Valid && p.IsDeleted == false)
|
||||
.Sum(p => p.Amount)
|
||||
})
|
||||
.ToListAsync();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user