用户个人优惠券数量bug修复
This commit is contained in:
parent
190d751289
commit
496afbda37
|
|
@ -193,4 +193,17 @@ public class DtsCouponService {
|
|||
.andEndTimeLessThan(LocalDate.now()).andDeletedEqualTo(false);
|
||||
return couponMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户的优惠券
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public int queryUserCouponCnt(Integer userId) {
|
||||
DtsCouponUserExample example = new DtsCouponUserExample();
|
||||
DtsCouponUserExample.Criteria criteria = example.createCriteria();
|
||||
criteria.andUserIdEqualTo(userId);
|
||||
criteria.andDeletedEqualTo(false);
|
||||
return (int) couponUserMapper.countByExample(example);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import java.util.Map;
|
|||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -110,7 +111,8 @@ public class WxCouponController {
|
|||
|
||||
List<DtsCouponUser> couponUserList = couponUserService.queryList(userId, null, status, page, size, sort, order);
|
||||
List<CouponVo> couponVoList = change(couponUserList);
|
||||
int total = couponService.queryTotal();
|
||||
long total = PageInfo.of(couponUserList).getTotal();
|
||||
//int total = couponService.queryTotal();
|
||||
Map<String, Object> data = new HashMap<String, Object>();
|
||||
data.put("data", couponVoList);
|
||||
data.put("count", total);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class WxUserController {
|
|||
data.put("remainAmount", remainAmount);
|
||||
|
||||
// 查询用户的优惠券
|
||||
int total = couponService.queryTotal();
|
||||
int total = couponService.queryUserCouponCnt(userId);
|
||||
data.put("couponCount", total);
|
||||
|
||||
logger.info("【请求结束】用户个人页面数据,响应结果:{}", JSONObject.toJSONString(data));
|
||||
|
|
|
|||
Loading…
Reference in New Issue