|
|
@@ -158,7 +158,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
private final UserBenefitsMapper userBenefitsMapper;
|
|
|
|
|
|
@Override
|
|
|
- public SearchResult<RenewalView> getMyTicket(long userId, Boolean isLoginPopularize, String customId, String account) {
|
|
|
+ public SearchResult<RenewalView> getMyTicket(long userId, Boolean isLoginPopularize, String customId, String account, String orderNo) {
|
|
|
User u = userMapper.selectById(userId);
|
|
|
if (u == null) throw BusinessRuntimeException.getGatewayApiCode(GatewayApiCode.CMS_TOKEN_VALID);
|
|
|
if (u.getIsBlack()) {
|
|
|
@@ -171,11 +171,15 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
|
|
|
if (StrUtil.isNotBlank(account)) {
|
|
|
builder.field(RenewalView::getAccount, account).op(Operator.Contain);
|
|
|
}
|
|
|
+ String conditionSql = String.format("(gr.expiry_time is null or gr.expiry_time > '%s')", now);
|
|
|
+ if (StrUtil.isNotEmpty(orderNo)) {
|
|
|
+ conditionSql += String.format(" and exists(select 1 from order_don o where o.user_id = gr.user_id and o.order_no = %s and o.status not in ('close','noPayment','refund'))", orderNo);
|
|
|
+ }
|
|
|
SearchResult<RenewalView> list = beanSearcher.search(RenewalView.class, builder
|
|
|
.field(RenewalView::getUserId, 0).op(Operator.GreaterThan)
|
|
|
.field(RenewalView::getUserId, userIds).op(Operator.InList)
|
|
|
//.field(RenewalView::getYhsId, yhsId)
|
|
|
- .put("condition", String.format("(gr.expiry_time is null or gr.expiry_time > '%s')", now))
|
|
|
+ .put("condition", conditionSql)
|
|
|
.field(RenewalView::getStatus, List.of("validity", "overdue", "outside")).op(Operator.InList)
|
|
|
.orderBy(RenewalView::getExpiryTime).asc()
|
|
|
.build());
|