关联关系 type
This commit is contained in:
parent
02e5684c0f
commit
c110695843
|
|
@ -121,16 +121,18 @@ public class ACouponController {
|
|||
|
||||
/**
|
||||
* 获取该券关联的功能列表
|
||||
*
|
||||
* @param couponId 如果syncId有值 则为syncId 否则为id
|
||||
*/
|
||||
@GetMapping("/gifts")
|
||||
public CzgResult<Page<MkCouponGiftDTO>> getCouponGiftPage(Long couponId) {
|
||||
Page<MkCouponGiftDTO> data = couponGiftService.getCouponGiftPage(couponId);
|
||||
public CzgResult<Page<MkCouponGiftDTO>> getCouponGiftPage(@RequestParam Long couponId, @RequestParam(required = false) Integer type) {
|
||||
Page<MkCouponGiftDTO> data = couponGiftService.getCouponGiftPage(couponId, type);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过关联Id取消该券的关联
|
||||
*
|
||||
* @param id /admin/coupon/gifts的 主键Id
|
||||
*/
|
||||
@DeleteMapping("/cancelGift")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public interface MkCouponGiftService extends IService<MkCouponGift> {
|
|||
/**
|
||||
* 券关联表查询
|
||||
*/
|
||||
Page<MkCouponGiftDTO> getCouponGiftPage(Long couponId);
|
||||
Page<MkCouponGiftDTO> getCouponGiftPage(Long couponId, Integer type);
|
||||
|
||||
/**
|
||||
* 根据sourceId查询关联券
|
||||
|
|
|
|||
|
|
@ -30,9 +30,10 @@ public class MkCouponGiftServiceImpl extends ServiceImpl<MkCouponGiftMapper, MkC
|
|||
private ShopCouponMapper couponMapper;
|
||||
|
||||
@Override
|
||||
public Page<MkCouponGiftDTO> getCouponGiftPage(Long couponId) {
|
||||
public Page<MkCouponGiftDTO> getCouponGiftPage(Long couponId, Integer type) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(MkCouponGift::getCouponId, couponId)
|
||||
.eq(MkCouponGift::getType, type)
|
||||
.orderBy(MkCouponGift::getId).desc();
|
||||
return pageAs(PageUtil.buildPage(), queryWrapper, MkCouponGiftDTO.class);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue