|
|
@@ -396,10 +396,12 @@ public class UserController {
|
|
|
@GetMapping("/get/giftCard")
|
|
|
public Result<SearchResult<GiftCardUserPayFrontView>> getGiftCard() {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
- String condition = String.format("and (user_id = %s or to_user_id = %s)", userId, userId);
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ String userIds = userIdList.toString().replace("[", "(").replace("]", ")");
|
|
|
+ String condition = String.format("and (user_id in %s or to_user_id in %s)", userIds, userIds);
|
|
|
SearchResult<GiftCardUserPayFrontView> view = beanSearcher.search(GiftCardUserPayFrontView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
.put("condition", condition)
|
|
|
- .put("uid", userId)
|
|
|
+ .put("uid", userIds)
|
|
|
.orderBy(GiftCardUserRecordView::getIsUsed).asc()
|
|
|
.orderBy(GiftCardUserPayFrontView::getId).desc().build());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(view);
|
|
|
@@ -411,10 +413,12 @@ public class UserController {
|
|
|
@GetMapping("/get/available/giftCard")
|
|
|
public Result<List<GiftCardUserPayFrontView>> getAvailGiftCard() {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
- String condition = String.format("and to_user_id = %s", userId);
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ String userIds = userIdList.toString().replace("[", "(").replace("]", ")");
|
|
|
+ String condition = String.format("and to_user_id in %s", userIds);
|
|
|
List<GiftCardUserPayFrontView> view = beanSearcher.searchAll(GiftCardUserPayFrontView.class, MapUtils.builder()
|
|
|
.put("condition", condition)
|
|
|
- .put("uid", userId)
|
|
|
+ .put("uid", userIds)
|
|
|
//现金卡
|
|
|
.field(GiftCardUserPayFrontView::getGcType, 1)
|
|
|
.orderBy(GiftCardUserRecordView::getIsUsed).asc()
|