通过用户Id 查找优惠券
This commit is contained in:
@@ -85,8 +85,11 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
|
||||
|
||||
|
||||
@Override
|
||||
public Page<ShopActivateCouponRecord> find(Long userId, Long orderId, Integer status) {
|
||||
List<Long> shopUserIds = shopUserService.queryChain().eq(ShopUser::getUserId, userId).select(ShopUser::getId).listAs(Long.class);
|
||||
public Page<ShopActivateCouponRecord> find(Long userId, Long shopId, Integer status) {
|
||||
List<Long> shopUserIds = shopUserService.queryChain()
|
||||
.eq(ShopUser::getUserId, userId)
|
||||
.eq(ShopUser::getShopId, shopId)
|
||||
.select(ShopUser::getId).listAs(Long.class);
|
||||
if (CollectionUtil.isNotEmpty(shopUserIds)) {
|
||||
return couponRecordService.findByUser(PageUtil.buildPage(), shopUserIds, status);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user