diff --git a/hiver-admin/src/main/resources/application.yml b/hiver-admin/src/main/resources/application.yml
index 0b35670f..c3edbcd8 100644
--- a/hiver-admin/src/main/resources/application.yml
+++ b/hiver-admin/src/main/resources/application.yml
@@ -337,6 +337,8 @@ ignored:
# 物流订单详情
- /hiver/app/logisticsOrder/getLogisticsOrderDetail
- /hiver/app/customer/findByUserPhoneAndShopId
+ # 分享页获取店铺分类
+ - app/productCategory/listByShopId
# 临时增加
- /hiver/app/logisticsOrder/addLogisticsOrder
diff --git a/hiver-admin/test-output/test-report.html b/hiver-admin/test-output/test-report.html
index 15225554..a91d2b9b 100644
--- a/hiver-admin/test-output/test-report.html
+++ b/hiver-admin/test-output/test-report.html
@@ -35,7 +35,7 @@
Hiver
- 06, 2024 13:53:46
+ 06, 2024 15:28:59
@@ -84,7 +84,7 @@
passTest
-
13:53:47 / 0.017 secs
+
15:29:00 / 0.026 secs
@@ -92,9 +92,9 @@
#test-id=1
passTest
-
09.06.2024 13:53:47
-
09.06.2024 13:53:47
-
0.017 secs
+
09.06.2024 15:29:00
+
09.06.2024 15:29:00
+
0.026 secs
@@ -104,7 +104,7 @@
| Pass |
- 13:53:47 |
+ 15:29:00 |
Test passed
|
@@ -128,13 +128,13 @@
Started
-
06, 2024 13:53:46
+
06, 2024 15:28:59
Ended
-
06, 2024 13:53:47
+
06, 2024 15:29:00
diff --git a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductCategoryController.java b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductCategoryController.java
index 72a09e59..62ebff20 100644
--- a/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductCategoryController.java
+++ b/hiver-modules/hiver-mall/src/main/java/cc/hiver/mall/controller/ProductCategoryController.java
@@ -90,6 +90,25 @@ public class ProductCategoryController {
return new ResultUtil
>().setData(list);
}
+ /**
+ * 前台传参查询店铺类别列表
+ * @author 王富康
+ * @date 2024/9/7
+ * @param shopId
+ * @return Result
+ */
+ @RequestMapping(value = "/listByShopId", method = RequestMethod.GET)
+ @ApiOperation(value = "前台传参查询店铺类别列表")
+ public Result listByShopId(String shopId) {
+ if(StringUtils.isEmpty(shopId)){
+ return ResultUtil.error("店铺信息不能为空");
+ }
+ QueryWrapper queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("shop_id", shopId);
+ List list = productCategoryService.list(queryWrapper);
+ return new ResultUtil>().setData(list);
+ }
+
/**
* 获取店铺下所有分类及分类的规格及规格的属性值
@@ -122,6 +141,23 @@ public class ProductCategoryController {
return new ResultUtil().setData(defaultCategory);
}
+ /**
+ * 根据前台传的shopId查询店铺默认分类
+ * @author 王富康
+ * @date 2024/9/7
+ * @param shopId
+ * @return Result
+ */
+ @RequestMapping(value = "/getDefaultCategoryByShopId", method = RequestMethod.POST)
+ @ApiOperation(value = "根据前台传的shopId查询店铺默认分类")
+ public Result getDefaultCategoryByShopId(String shopId){
+ if(StringUtils.isEmpty(shopId)){
+ return ResultUtil.error("店铺id不能为空");
+ }
+ ProductCategoryVo defaultCategory = productCategoryService.getDefaultCategory(shopId);
+ return new ResultUtil().setData(defaultCategory);
+ }
+
@RequestMapping(value = "/getCategoryOfshop", method = RequestMethod.POST)
@ApiOperation(value = "查询店铺规格")
public Result getCategoryOfshop(){
diff --git a/hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml b/hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml
index d8cbc886..339bd95a 100644
--- a/hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml
+++ b/hiver-modules/hiver-mall/src/main/resources/mapper/ProductMapper.xml
@@ -574,25 +574,25 @@
) ss
ON ss.product_id = t.id
and ss.shop_id = t.shop_id
- LEFT JOIN (
- SELECT
- sd.product_id,
- SUM(sd.product_count) AS total_sold
- FROM
- t_sale_detail sd
- INNER JOIN t_sale s ON sd.sale_id = s.id
- WHERE
- s.del_flag = '0'
- AND s.status = '4'
-
+
+ LEFT JOIN (
+ SELECT
+ sd.product_id,
+ SUM(sd.product_count) AS total_sold
+ FROM
+ t_sale_detail sd
+ INNER JOIN t_sale s ON sd.sale_id = s.id
+ WHERE
+ s.del_flag = '0'
+ AND s.status = '4'
and s.create_time BETWEEN #{queryParams.startDate} AND #{queryParams.endDate}
-
-
- and s.create_time >= DATE_SUB(CURDATE(), INTERVAL 7 DAY)
-
- GROUP BY
- product_id
- ) sd ON t.id = sd.product_id
+
+ GROUP BY
+ product_id
+ ) sd ON t.id = sd.product_id
+
AND t.del_flag != '2'
@@ -637,9 +637,12 @@
ORDER BY
-
- sd.total_sold desc,
+
+
+ sd.total_sold desc,
+
+
t.in_storage_status asc, t.del_flag desc,t.create_time desc, id