xiongzhu 5 years ago
parent
commit
35a1cbe7a3

+ 1 - 1
src/main/java/com/izouma/jiashanxia/repo/UserPackageFlowRepo.java

@@ -16,5 +16,5 @@ public interface UserPackageFlowRepo extends JpaRepository<UserPackageFlow, Long
     @Transactional
     @Transactional
     void softDelete(Long id);
     void softDelete(Long id);
 
 
-    List<UserPackageFlow> findAllByUserId(Long userId);
+    List<UserPackageFlow> findAllByUserIdOrderByCreatedAtDesc(Long userId);
 }
 }

+ 1 - 1
src/main/java/com/izouma/jiashanxia/service/UserPackageFlowService.java

@@ -90,7 +90,7 @@ public class UserPackageFlowService {
     public List<UserPackageFlowVO> my(Long userId) {
     public List<UserPackageFlowVO> my(Long userId) {
         List<UserPackageFlowVO> vos = new ArrayList<>();
         List<UserPackageFlowVO> vos = new ArrayList<>();
         // 查找用户相关
         // 查找用户相关
-        List<UserPackageFlow> flows = userPackageFlowRepo.findAllByUserId(userId);
+        List<UserPackageFlow> flows = userPackageFlowRepo.findAllByUserIdOrderByCreatedAtDesc(userId);
 //        Set<Long> goodsId = new HashSet<>();
 //        Set<Long> goodsId = new HashSet<>();
 //        // 找出相关商品
 //        // 找出相关商品
 //        flows.forEach(flow -> {
 //        flows.forEach(flow -> {