秒杀和拼团列表过滤已过期活动 #39

Merged
root merged 5 commits from cxw into master 2024-10-09 18:26:34 +08:00
6 changed files with 10 additions and 5 deletions

View File

@ -116,7 +116,7 @@ public class AppSeckillActivityController {
@Operation(summary = "获得秒杀活动分页") @Operation(summary = "获得秒杀活动分页")
public CommonResult<List<ProductSpuRespDTO>> getSeckillActivitySupList(@RequestParam(name = "count", defaultValue = "6") Integer count) { public CommonResult<List<ProductSpuRespDTO>> getSeckillActivitySupList(@RequestParam(name = "count", defaultValue = "6") Integer count) {
AppSeckillActivityPageReqVO pageReqVO = new AppSeckillActivityPageReqVO(); AppSeckillActivityPageReqVO pageReqVO = new AppSeckillActivityPageReqVO();
if (count == null || count == 0){ if (count != null && count != 0){
pageReqVO.setPageNo(1); pageReqVO.setPageNo(1);
pageReqVO.setPageSize(count); pageReqVO.setPageSize(count);
} }

View File

@ -36,12 +36,14 @@ public interface CombinationActivityMapper extends BaseMapperX<CombinationActivi
default PageResult<CombinationActivityDO> selectPage(PageParam pageParam, Integer status) { default PageResult<CombinationActivityDO> selectPage(PageParam pageParam, Integer status) {
return selectPage(pageParam, new LambdaQueryWrapperX<CombinationActivityDO>() return selectPage(pageParam, new LambdaQueryWrapperX<CombinationActivityDO>()
.eq(CombinationActivityDO::getStatus, status)); .eq(CombinationActivityDO::getStatus, status)
.ge(CombinationActivityDO::getEndTime, LocalDateTime.now()));
} }
default List<CombinationActivityDO> selectListByStatus(Integer status, Integer count) { default List<CombinationActivityDO> selectListByStatus(Integer status, Integer count) {
return selectList(new LambdaQueryWrapperX<CombinationActivityDO>() return selectList(new LambdaQueryWrapperX<CombinationActivityDO>()
.eq(CombinationActivityDO::getStatus, status) .eq(CombinationActivityDO::getStatus, status)
.ge(CombinationActivityDO::getEndTime, LocalDateTime.now())
.last("LIMIT " + count)); .last("LIMIT " + count));
} }

View File

@ -72,6 +72,7 @@ public interface SeckillActivityMapper extends BaseMapperX<SeckillActivityDO> {
default PageResult<SeckillActivityDO> selectPage(AppSeckillActivityPageReqVO pageReqVO, Integer status) { default PageResult<SeckillActivityDO> selectPage(AppSeckillActivityPageReqVO pageReqVO, Integer status) {
return selectPage(pageReqVO, new LambdaQueryWrapperX<SeckillActivityDO>() return selectPage(pageReqVO, new LambdaQueryWrapperX<SeckillActivityDO>()
.eqIfPresent(SeckillActivityDO::getStatus, status) .eqIfPresent(SeckillActivityDO::getStatus, status)
.ge(SeckillActivityDO::getEndTime, LocalDateTime.now())
// TODO 芋艿 find in set 的想法 // TODO 芋艿 find in set 的想法
.apply(ObjectUtil.isNotNull(pageReqVO.getConfigId()), "FIND_IN_SET(" + pageReqVO.getConfigId() + ",config_ids) > 0")); .apply(ObjectUtil.isNotNull(pageReqVO.getConfigId()), "FIND_IN_SET(" + pageReqVO.getConfigId() + ",config_ids) > 0"));
} }

View File

@ -101,7 +101,7 @@ public interface CombinationActivityService {
List<CombinationActivityDO> getCombinationActivityListByIds(Collection<Long> ids); List<CombinationActivityDO> getCombinationActivityListByIds(Collection<Long> ids);
/** /**
* 获取正在进行的活动分页数据 * 获取正在进行的活动分页数据同时活动未过期
* *
* @param count 需要的数量 * @param count 需要的数量
* @return 拼团活动分页 * @return 拼团活动分页
@ -109,7 +109,7 @@ public interface CombinationActivityService {
List<CombinationActivityDO> getCombinationActivityListByCount(Integer count); List<CombinationActivityDO> getCombinationActivityListByCount(Integer count);
/** /**
* 获取正在进行的活动分页数据 * 获取正在进行的活动分页数据同时活动未过期
* *
* @param pageParam 分页请求 * @param pageParam 分页请求
* @return 拼团活动分页 * @return 拼团活动分页

View File

@ -44,7 +44,7 @@ public class MemberUserPageReqVO extends PageParam {
@Schema(description = "权益id", example = "1") @Schema(description = "权益id", example = "1")
private Long noticeInterestId; private Long noticeInterestId;
@Schema(description = "是否绑过", example = "1") @Schema(description = "是否激活", example = "1")
private Integer activate; private Integer activate;
// TODO 芋艿注册用户类型 // TODO 芋艿注册用户类型

View File

@ -52,4 +52,6 @@ public class MemberUserRespVO extends MemberUserBaseVO {
@Schema(description = "用户经验值", requiredMode = Schema.RequiredMode.REQUIRED, example = "200") @Schema(description = "用户经验值", requiredMode = Schema.RequiredMode.REQUIRED, example = "200")
private Integer experience; private Integer experience;
@Schema(description = "是否激活卡", example = "1")
private Integer activate;
} }