From c197d6e58b762e67091319ef423c4b28a7daba79 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期一, 09 十二月 2024 18:34:06 +0800
Subject: [PATCH] 合并代码

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java |    6 ++++++
 1 files changed, 6 insertions(+), 0 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 987abec..64c2bd0 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
@@ -5,11 +5,13 @@
 import com.ruoyi.account.api.feignClient.AppUserClient;
 import com.ruoyi.account.api.model.AppUser;
 import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.security.service.TokenService;
 import com.ruoyi.other.api.domain.Goods;
 import com.ruoyi.other.api.domain.GoodsEvaluate;
 import com.ruoyi.other.service.GoodsEvaluateService;
 import com.ruoyi.other.service.GoodsService;
 import com.ruoyi.other.vo.GoodsEvaluateVO;
+import com.ruoyi.system.api.model.LoginUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -37,6 +39,8 @@
     private AppUserClient appUserClient;
     @Resource
     private GoodsService goodsService;
+    @Resource
+    private TokenService tokenService;
 
     @GetMapping("/goodsList")
     @ApiOperation(value = "获取商品评价", tags = {"小程序-获取商品评价"})
@@ -67,8 +71,10 @@
     @GetMapping("/detail/{orderId}")
     @ApiOperation(value = "评论详情", tags = {"小程序-评论详情"})
     public R<List<GoodsEvaluate>> detail(@PathVariable("orderId") Long orderId){
+        LoginUser loginUserApplet = tokenService.getLoginUserApplet();
         List<GoodsEvaluate> list = goodsEvaluateService.list(new LambdaQueryWrapper<GoodsEvaluate>()
                 .eq(GoodsEvaluate::getStatus, 2)
+                .eq(GoodsEvaluate::getAppUserId,loginUserApplet.getUserid())
                 .eq(GoodsEvaluate::getOrderId, orderId));
         for (GoodsEvaluate goodsEvaluate : list) {
             Goods goods = goodsService.getById(goodsEvaluate.getGoodsId());

--
Gitblit v1.7.1