|
@@ -53,18 +53,18 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon>
|
|
if (objects == null){
|
|
if (objects == null){
|
|
return R.failed("没有优惠券");
|
|
return R.failed("没有优惠券");
|
|
}
|
|
}
|
|
- System.err.println(objects);
|
|
|
|
Course course = courseMapper.selectById(primary.getCouponId());
|
|
Course course = courseMapper.selectById(primary.getCouponId());
|
|
List<Coupon> list=new ArrayList<>();
|
|
List<Coupon> list=new ArrayList<>();
|
|
|
|
+
|
|
for (Long i:objects){
|
|
for (Long i:objects){
|
|
Date date1=new Date();
|
|
Date date1=new Date();
|
|
list.add(this.baseMapper.selectOne(new QueryWrapper<Coupon>().eq("id",i).ge("condition_amount",course.getPrice()).ge("start_time",date1)));
|
|
list.add(this.baseMapper.selectOne(new QueryWrapper<Coupon>().eq("id",i).ge("condition_amount",course.getPrice()).ge("start_time",date1)));
|
|
System.err.println(list);
|
|
System.err.println(list);
|
|
}
|
|
}
|
|
- if (list==null){
|
|
|
|
- return R.failed("没有可用的优惠券");
|
|
|
|
|
|
+ if (list!=null){
|
|
|
|
+ return R.ok(list);
|
|
}
|
|
}
|
|
- return R.ok(list);
|
|
|
|
|
|
+ return R.failed("没有可用的优惠券");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|