Skip to content

Commit

Permalink
Merge pull request #89 from lotteon2/fix/admin-products-order-by
Browse files Browse the repository at this point in the history
fix: 관리자 상품 조회 순서 수정
  • Loading branch information
qwerty1434 authored Jan 17, 2024
2 parents f59f9e7 + c842277 commit 6fa3bfb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,13 @@ public Page<Product> findProductsForAdmin(
ProductCommand.AdminSelectOption adminSelectOption, Pageable pageable) {
Query query = new Query();
query.addCriteria(Criteria.where("is_subscription").is(false));
if (adminSelectOption.getStatus() != null)
query.addCriteria(Criteria.where("product_sale_status").is(adminSelectOption.getStatus()));

if (adminSelectOption.getSalesAmount().equals(SortOption.HIGH))
query.with(Sort.by(Order.desc(adminSelectOption.getSalesAmount().getSortOption())));
else query.with(Sort.by(Order.asc(adminSelectOption.getSalesAmount().getSortOption())));

if (adminSelectOption.getStatus() != null)
query.addCriteria(Criteria.where("product_sale_status").is(adminSelectOption.getStatus()));

if (adminSelectOption.getDate().equals(SortOption.NEW))
query.with(Sort.by(Order.desc(adminSelectOption.getDate().getSortOption())));
else query.with(Sort.by(Order.asc(adminSelectOption.getDate().getSortOption())));
Expand Down

0 comments on commit 6fa3bfb

Please sign in to comment.