From 451116c1df3c639da15b3d213f3fcff2f585337a Mon Sep 17 00:00:00 2001
From: huliguo <2023611923@qq.com>
Date: 星期二, 15 四月 2025 19:22:52 +0800
Subject: [PATCH] 前端联调

---
 ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java |   10 +++++++---
 1 files changed, 7 insertions(+), 3 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 a15a122..947109e 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
@@ -92,9 +92,9 @@
      */
     @PostMapping("/addGoodsEvaluate")
     @ApiOperation(value = "发布商品评价", tags = {"小程序-个人中心-我的订单"})
-    public R<Void> addGoodsEvaluate(@RequestBody GoodsEvaluate goodsEvaluate){
-        goodsEvaluateService.addGoodsEvaluate(goodsEvaluate);
-        return R.ok();
+    public R addGoodsEvaluate(@RequestBody GoodsEvaluate goodsEvaluate){
+
+        return goodsEvaluateService.addGoodsEvaluate(goodsEvaluate);
     }
 
     /**
@@ -107,6 +107,9 @@
                 .eq(GoodsEvaluate::getStatus, 2)
                 .eq(GoodsEvaluate::getDelFlag, 0)
                 .eq(GoodsEvaluate::getOrderId, orderId));
+        if(evaluate==null){
+            return R.fail("未评价");
+        }
         Goods goods = goodsService.getById(evaluate.getGoodsId());
         evaluate.setGoodsName(goods.getName());
         evaluate.setGoodsImg(goods.getHomePagePicture());
@@ -195,6 +198,7 @@
         Goods goods = goodsService.getById(item.getGoodsId());
         if(null != goods){
             item.setGoodsName(goods.getName());
+            item.setGoodsImg(goods.getHomePagePicture());
         }
     }
 

--
Gitblit v1.7.1