Browse Source

Fix `FlashSalePlanAppService.CreateFilteredQueryAsync` method

pull/209/head
gdlcf88 4 years ago
parent
commit
2177adec7b
  1. 10
      plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanAppService.cs

10
plugins/FlashSales/src/EasyAbp.EShop.Plugins.FlashSales.Application/EasyAbp/EShop/Plugins/FlashSales/FlashSalePlans/FlashSalePlanAppService.cs

@ -121,6 +121,11 @@ public class FlashSalePlanAppService :
{ {
await CheckGetListPolicyAsync(); await CheckGetListPolicyAsync();
if (input.IncludeUnpublished)
{
await CheckMultiStorePolicyAsync(input.StoreId, FlashSalesPermissions.FlashSalePlan.Manage);
}
return await base.GetListAsync(input); return await base.GetListAsync(input);
} }
@ -191,11 +196,6 @@ public class FlashSalePlanAppService :
protected override async Task<IQueryable<FlashSalePlan>> CreateFilteredQueryAsync(FlashSalePlanGetListInput input) protected override async Task<IQueryable<FlashSalePlan>> CreateFilteredQueryAsync(FlashSalePlanGetListInput input)
{ {
if (input.IncludeUnpublished)
{
await CheckMultiStorePolicyAsync(input.StoreId, FlashSalesPermissions.FlashSalePlan.Manage);
}
return (await base.CreateFilteredQueryAsync(input)) return (await base.CreateFilteredQueryAsync(input))
.WhereIf(input.StoreId.HasValue, x => x.StoreId == input.StoreId.Value) .WhereIf(input.StoreId.HasValue, x => x.StoreId == input.StoreId.Value)
.WhereIf(input.ProductId.HasValue, x => x.ProductId == input.ProductId.Value) .WhereIf(input.ProductId.HasValue, x => x.ProductId == input.ProductId.Value)

Loading…
Cancel
Save