| | |
| | | |
| | | @GetMapping("/mine/list1") |
| | | @ApiOperation(value = "已领取列表", tags = {"管理后台-优惠劵"}) |
| | | public R<Page<UserCoupon>> list1(@RequestParam Integer pageNum, @RequestParam Integer pageSize, @ApiParam("1未使用2已使用3已过期") Integer status, Integer id) { |
| | | public R<Page<UserCoupon>> list1(@RequestParam Integer pageNum, |
| | | @RequestParam Integer pageSize, |
| | | @ApiParam("1未使用2已使用3已过期") Integer status, |
| | | String phone, |
| | | Integer id) { |
| | | |
| | | AppUser appUser1 = appUserService.getOne(new LambdaQueryWrapper<AppUser>() |
| | | .eq(AppUser::getPhone, phone)); |
| | | |
| | | Long appUserId = appUser1.getId(); |
| | | Page<UserCoupon> page = userCouponService.lambdaQuery() |
| | | .isNull(status!=null&&(status==1||status==3),UserCoupon::getUseTime) |
| | | .isNotNull(status!=null&&status==2,UserCoupon::getUseTime) |
| | | .eq(UserCoupon::getCouponId, id) |
| | | .eq(appUserId != null,UserCoupon::getAppUserId, appUserId) |
| | | .lt(status!=null&&status==3,UserCoupon::getEndTime, LocalDateTime.now()).page(Page.of(pageNum-1, pageSize)); |
| | | for (UserCoupon record : page.getRecords()) { |
| | | record.setIdStr(record.getId().toString()); |