Browse Source

feat(reservation): 添加预约分类显示条件和排序功能

- 在查询预约分类时添加了显示状态过滤条件
- 按创建时间降序排列预约分类
- 优化代码格式提高可读性
fcw 1 month ago
parent
commit
09134b1427

+ 5 - 1
alien-store/src/main/java/shop/alien/store/service/impl/UserReservationServiceImpl.java

@@ -468,7 +468,11 @@ public class UserReservationServiceImpl extends ServiceImpl<UserReservationMappe
         
         List<StoreBookingTable> storeBookingTables = storeBookingTableService.list(new LambdaQueryWrapper<StoreBookingTable>().eq(StoreBookingTable::getStoreId, storeId));
         list.put("storeBookingTables", storeBookingTables);
-        List<StoreBookingCategory> storeBookingCategorys = storeBookingCategoryService.list(new LambdaQueryWrapper<StoreBookingCategory>().eq(StoreBookingCategory::getStoreId, storeId));
+        List<StoreBookingCategory> storeBookingCategorys = storeBookingCategoryService.list(
+                new LambdaQueryWrapper<StoreBookingCategory>()
+                        .eq(StoreBookingCategory::getStoreId, storeId)
+                        .eq(StoreBookingCategory::getIsDisplay, 1)
+                        .orderByDesc(StoreBookingCategory::getCreatedTime));
         list.put("storeBookingCategorys", storeBookingCategorys);
         StoreMainInfoVo storeInfo = storeInfoService.getStoreInfo(storeId);
         list.put("storeInfo", storeInfo);