|
@@ -44,12 +44,12 @@ namespace ZhonTai.Admin.Services.Banner
|
|
|
[HttpPost]
|
|
|
public async Task<PageOutput<BannerListOutput>> GetPageAsync(PageInput<BannerGetPageDto> input)
|
|
|
{
|
|
|
- //1未开始 2进行中 3已结束
|
|
|
+ // 0待上架 1上架 2下架
|
|
|
var status = input.Filter?.Status;
|
|
|
DateTime dtnow = DateTime.Now;
|
|
|
|
|
|
var list = await _bannerRepository.Select
|
|
|
- .WhereIf(status.HasValue && status >= 0, a => a.Status > status)
|
|
|
+ .WhereIf(status.HasValue && status >= 0, a => a.Status == status)
|
|
|
.Count(out var total)
|
|
|
.OrderByDescending(true, c => c.Rank)
|
|
|
.OrderByDescending(true, c => c.Id)
|
|
@@ -109,9 +109,10 @@ namespace ZhonTai.Admin.Services.Banner
|
|
|
/// </summary>
|
|
|
/// <param name="id"></param>
|
|
|
/// <returns></returns>
|
|
|
+ [HttpGet]
|
|
|
public async Task UpdateStatus(long id,int status)
|
|
|
{
|
|
|
- if (id <= 0 || !new[] { 2,3}.Contains(status)) {
|
|
|
+ if (id <= 0 || !new[] { 1,2}.Contains(status)) {
|
|
|
throw ResultOutput.Exception("缺少有效参数,请刷新后重试");
|
|
|
}
|
|
|
var entity = await _bannerRepository.GetAsync(id);
|