Skip to content

Commit

Permalink
chore: get my order list that are paid
Browse files Browse the repository at this point in the history
  • Loading branch information
Kang1221 committed Sep 11, 2024
1 parent a71ef53 commit 7b931f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@

public interface OrderRepository extends JpaRepository<Order, String> {

List<Order> findByBuyer(User user);
@Query("SELECT o from Order o where o.buyer = :user AND o.status <>'ORDER_PENDING'")
List<Order> findByBuyerAndStatus(User user);

@Query("SELECT o from Order o where o.item = :item")
Optional<Order> findByItem(@Param("item") Item item);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/co/orange/ddanzi/service/OrderService.java
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public Integer getMyOrderCount(User user){
}

public List<MyOrder> getMyOrderList(User user){
List<Order> orderList = orderRepository.findByBuyer(user);
List<Order> orderList = orderRepository.findByBuyerAndStatus(user);

List<MyOrder> orderProductList = new ArrayList<>();

Expand Down

0 comments on commit 7b931f2

Please sign in to comment.