fix 券发放查询增加厂区

This commit is contained in:
2025-12-17 11:06:18 +08:00
parent 4bca8859ef
commit 54ed9e5933
5 changed files with 17 additions and 8 deletions

View File

@@ -26,12 +26,13 @@ public abstract class BaseVoucherService : IVoucherService
public async Task<Pagination<VoucherPageResponse>> GetPageAsync(VoucherPageRequest request)
{
var tenantId = _currentUser.GetStringTenantId();
//var tenantId = _currentUser.GetStringTenantId();
var pagination = await DbContext.Queryable<VoucherEntity>()
.LeftJoin<VoucherUserInfoEntity>((x, u) => x.No == u.VoucherNo)
.LeftJoin<GainfoEntity>((x, u, ga) => u.UserCode == ga.Code)
.Where((x, u) => x.Type == request.Type && u.Factory == tenantId)
.Where((x, u) => x.Type == request.Type)
.WhereIF(request.Factories.IsPresent(), (x, u) => request.Factories.Contains(u.Factory))
.WhereIF(request.UserCode.IsPresent(), (x, u, ga) => u.UserCode == request.UserCode)
.WhereIF(request.SearchDateTimePeriod.HasValue(),
(x, u, ga) => x.CreateTime >= request.SearchDateTimePeriod.Start &&