wangqifan 4 anni fa
parent
commit
96c704ff3c

+ 2 - 2
src/main/java/com/izouma/tcg/repo/card/CardCaseRepo.java

@@ -23,13 +23,13 @@ public interface CardCaseRepo extends JpaRepository<CardCase, Long>, JpaSpecific
     @Query("SELECT new com.izouma.tcg.dto.cardCase.CaseDTO(" +
             "   s.id, s.startTime, s.images, s.customName, " +
             "   s.boxPrice, s.caseStatus, s.special, s.roomId, s.liveNow, s.instant,s.collectionId) " +
-            "FROM CardCase s WHERE s.caseStatus = ?1 and s.seriesId = ?2 and s.del = false")
+            "FROM CardCase s WHERE s.caseStatus = ?1 and s.seriesId = ?2 and s.del = false order by s.createdAt desc ")
     Page<CaseDTO> customFindList1(CaseStatus caseStatus, Long seriesId, Pageable pageable);
 
     @Query("SELECT new com.izouma.tcg.dto.cardCase.CaseDTO(" +
             "   s.id, s.startTime, s.images, s.customName, " +
             "   s.boxPrice, s.caseStatus, s.special, s.roomId, s.liveNow, s.instant,s.collectionId) " +
-            "FROM CardCase s WHERE s.caseStatus = ?1 and s.seriesId = ?3 and s.collectionId in ?2 and s.del = false ")
+            "FROM CardCase s WHERE s.caseStatus = ?1 and s.seriesId = ?3 and s.collectionId in ?2 and s.del = false order by s.createdAt desc ")
     Page<CaseDTO> customFindList2(CaseStatus caseStatus, Set<Long> collectionId, Long seriesId, Pageable pageable);
 
     List<CardCase> findAllByRoomIdAndStoreId(Long roomId, Long storeId);

+ 9 - 2
src/main/java/com/izouma/tcg/web/card/CardCaseController.java

@@ -67,7 +67,7 @@ public class CardCaseController extends BaseController {
     @GetMapping("/excel")
     @ResponseBody
     public void excel(HttpServletResponse response, Pageable pageable) throws IOException {
-        List<CardCaseDTO> data = showCardCasesMA(null, null, null, 103L, pageable).getContent();
+        List<CardCaseDTO> data = showCardCasesMA(null, null, null, 103L, pageable);
         ExcelUtils.export(response, data);
     }
 
@@ -80,7 +80,14 @@ public class CardCaseController extends BaseController {
 
     @GetMapping("/showCasesMA")
     @ApiOperation("获取卡箱列表")
-    public Page<CardCaseDTO> showCardCasesMA(CaseStatus caseStatus, @RequestParam(required = false) Long collectionId,
+    public List<CardCaseDTO> showCardCasesMA(CaseStatus caseStatus, @RequestParam(required = false) Long collectionId,
+                                             @RequestParam(required = false) String search, @RequestParam(required = true) Long seriesId, Pageable pageable) {
+        return cardCaseService.showCardCasesMA(caseStatus, collectionId, search, seriesId, pageable).getContent();
+    }
+
+    @GetMapping("/showCasesMA2")
+    @ApiOperation("获取卡箱列表")
+    public Page<CardCaseDTO> showCardCasesMA2(CaseStatus caseStatus, @RequestParam(required = false) Long collectionId,
                                              @RequestParam(required = false) String search, @RequestParam(required = true) Long seriesId, Pageable pageable) {
         return cardCaseService.showCardCasesMA(caseStatus, collectionId, search, seriesId, pageable);
     }