zoujiajian hace 1 año
padre
commit
e0e00ce839

+ 4 - 3
netflix-web/src/main/java/com/cyksj/web/controller/user/UserController.java

@@ -123,11 +123,12 @@ public class UserController {
     @GetMapping("/personal")
     public Result<UserPersonalView> getPersonalView(String customId) {
         long userId = StpUserUtil.getLoginIdAsLong();
-        List<Long> userIds = userBindRelationService.getRelationUserIdList(userId, null);
+        List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
+        String userIds = userIdList.toString().replace("[", "(").replace("]", ")");
         MapBuilder builder = MapUtils.flatBuilder(request.getParameterMap());
         List<RenewalView> renewalViews = beanSearcher.searchAll(RenewalView.class, builder
                 .field(RenewalView::getUserId, 0).op(Operator.GreaterThan)
-                .field(RenewalView::getUserId, userIds).op(Operator.InList)
+                .field(RenewalView::getUserId, userIdList).op(Operator.InList)
                 .field(RenewalView::getStatus, List.of("validity", "overdue", "outside")).op(Operator.InList)
                 .orderBy(RenewalView::getExpiryTime).asc()
                 .onlySelect(RenewalView::getExpiryTime)
@@ -161,7 +162,7 @@ public class UserController {
         personalView.setIsNoPayment(orderDon != null ? true : false);
         //礼品卡可用数量
         Number numOfGiftCard = beanSearcher.searchCount(GiftCardUserRecordView.class, MapUtils.builder()
-                .put("uid", String.format("((user_id = %s and is_send = 0) or (to_user_id = %s and is_used = 0))", userId, userId))
+                .put("uid", String.format("((user_id in %s and is_send = 0) or (to_user_id in %s and is_used = 0))", userIds, userIds))
                 .field(GiftCardUserRecordView::getIsPay, true)
                 .build());
         personalView.setNumOfGiftCard(numOfGiftCard.intValue());