From f6b20962bb0453683e9366a3f87b7ec9bfaed03c Mon Sep 17 00:00:00 2001
From: xuhy <3313886187@qq.com>
Date: 星期二, 14 一月 2025 15:18:58 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java
index 8572df7..9a6fa18 100644
--- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java
+++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java
@@ -8,6 +8,7 @@
 import com.ruoyi.account.api.model.AppUser;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.utils.StringUtils;
+import com.ruoyi.common.core.web.page.PageInfo;
 import com.ruoyi.common.security.service.TokenService;
 import com.ruoyi.order.feignClient.OrderClient;
 import com.ruoyi.order.model.Order;
@@ -56,10 +57,12 @@
 
     @GetMapping("/goodsList")
     @ApiOperation(value = "获取商品评价", tags = {"小程序-获取商品评价"})
-    public R<List<GoodsEvaluate>> goodsList(@ApiParam("商品id") Integer goodsId){
-        List<GoodsEvaluate> list = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId).eq(GoodsEvaluate::getDelFlag, 0)
-                .eq(GoodsEvaluate::getStatus, 2).isNotNull(GoodsEvaluate::getComment).ne(GoodsEvaluate::getComment, "").orderByDesc(GoodsEvaluate::getCreateTime).list();
-        for (GoodsEvaluate goodsEvaluate : list) {
+    public R<PageInfo<GoodsEvaluate>> goodsList(@ApiParam("商品id") Integer goodsId, Integer pageNum, Integer pageSize){
+        PageInfo<GoodsEvaluate> pageInfo = new PageInfo<>(pageNum, pageSize);
+        PageInfo<GoodsEvaluate> page = goodsEvaluateService.lambdaQuery().eq(GoodsEvaluate::getGoodsId, goodsId).eq(GoodsEvaluate::getDelFlag, 0)
+                .eq(GoodsEvaluate::getStatus, 2).isNotNull(GoodsEvaluate::getComment).ne(GoodsEvaluate::getComment, "")
+                .orderByDesc(GoodsEvaluate::getCreateTime).page(pageInfo);
+        for (GoodsEvaluate goodsEvaluate : page.getRecords()) {
             AppUser appUserById = appUserClient.getAppUserById(goodsEvaluate.getAppUserId());
             if(null != appUserById){
                 goodsEvaluate.setUserName(appUserById.getName());
@@ -67,7 +70,7 @@
                 goodsEvaluate.setIdStr(String.valueOf(goodsEvaluate.getId()));
             }
         }
-        return R.ok(list);
+        return R.ok(page);
     }
 
     /**

--
Gitblit v1.7.1