From f103ac7bc4f2fbb20a0f2dd3ed97b0ac7fc5f46d Mon Sep 17 00:00:00 2001
From: huliguo <2023611923@qq.com>
Date: 星期五, 11 四月 2025 17:40:24 +0800
Subject: [PATCH] 商家端

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java |   11 +++++++----
 1 files changed, 7 insertions(+), 4 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 5089e17..a15a122 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
@@ -56,12 +56,12 @@
 
 
     /**
-     * 通过用户id和商品id查询评价id
+     * 通过订单id查询评价id
      */
-    @GetMapping("/getEvaluateIdByUserIdAndGoodId")
-    public R<Long> getEvaluateIdByUserIdAndGoodId(@RequestParam("goodId") Integer goodId, @RequestParam("userId") Long userId) {
+    @GetMapping("/getEvaluateIdByOrderId")
+    public R<Long> getEvaluateIdByOrderId( @RequestParam("orderId") Long orderId) {
         GoodsEvaluate evaluate = goodsEvaluateMapper.selectOne(new LambdaQueryWrapper<GoodsEvaluate>()
-                .eq(GoodsEvaluate::getGoodsId, goodId).eq(GoodsEvaluate::getAppUserId, userId));
+                .eq(GoodsEvaluate::getOrderId, orderId).eq(GoodsEvaluate::getDelFlag,0).eq(GoodsEvaluate::getStatus,2));
         if (evaluate != null) {
             return R.ok(evaluate.getId());
         }
@@ -205,6 +205,9 @@
     @ApiOperation(value = "评论详情", tags = {"管理后台-商品管理-评价管理","门店后台-订单-查看用户评价详情"})
     public R<GoodsEvaluate> getDetail(@PathVariable("id") Long id){
         GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id);
+        if (null==goodsEvaluate){
+            return R.fail("未找到该评论");
+        }
         buildDetail(goodsEvaluate);
         return R.ok(goodsEvaluate);
     }

--
Gitblit v1.7.1