From 12b8ccc96996918b4e910791f1a3ff10c3d59aa2 Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Thu, 23 Jan 2025 12:00:11 +0800
Subject: [PATCH] feat(mall): 商品统计增加规格信息

---
 src/main/resources/templates/febs/views/modules/order/goodsStatistics.html |    1 +
 src/main/java/cc/mrbird/febs/mall/vo/AdminGoodsStatisticsVo.java           |    1 +
 src/main/resources/mapper/modules/MallOrderInfoMapper.xml                  |    5 +++--
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/mall/vo/AdminGoodsStatisticsVo.java b/src/main/java/cc/mrbird/febs/mall/vo/AdminGoodsStatisticsVo.java
index 4b32ba0..8c17c71 100644
--- a/src/main/java/cc/mrbird/febs/mall/vo/AdminGoodsStatisticsVo.java
+++ b/src/main/java/cc/mrbird/febs/mall/vo/AdminGoodsStatisticsVo.java
@@ -6,6 +6,7 @@
 @Data
 @ApiModel(value = "AdminGoodsStatisticsVo", description = "信息返回类")
 public class AdminGoodsStatisticsVo {
+    private String skuName;
     private String goodsName;
     private Integer goodsCnt;
 }
diff --git a/src/main/resources/mapper/modules/MallOrderInfoMapper.xml b/src/main/resources/mapper/modules/MallOrderInfoMapper.xml
index 9e7f9e6..44d16a2 100644
--- a/src/main/resources/mapper/modules/MallOrderInfoMapper.xml
+++ b/src/main/resources/mapper/modules/MallOrderInfoMapper.xml
@@ -439,6 +439,7 @@
     <select id="getGoodsStatisticsInPage" resultType="cc.mrbird.febs.mall.vo.AdminGoodsStatisticsVo">
         select
             goods_name goodsName,
+            sku_name skuName,
             SUM(cnt) goodsCnt
         from mall_order_item
         <where>
@@ -450,8 +451,8 @@
                     </foreach>
             </if>
         </where>
-            GROUP BY goods_id
-            ORDER BY goods_id desc
+            GROUP BY sku_id
+            ORDER BY sku_id desc
     </select>
 
     <select id="selectAmountOrTeamAmount" resultType="java.math.BigDecimal">
diff --git a/src/main/resources/templates/febs/views/modules/order/goodsStatistics.html b/src/main/resources/templates/febs/views/modules/order/goodsStatistics.html
index f7aa027..168c235 100644
--- a/src/main/resources/templates/febs/views/modules/order/goodsStatistics.html
+++ b/src/main/resources/templates/febs/views/modules/order/goodsStatistics.html
@@ -32,6 +32,7 @@
                 toolbar: '#tableToolBarOrderSatistics',
                 cols: [[
                     {field: 'goodsName', title: '商品名称', minWidth: 130},
+                    {field: 'skuName', title: '规格', minWidth: 130},
                     {field: 'goodsCnt', title: '总数', minWidth: 130}
                 ]]
             });

--
Gitblit v1.9.1