fix(store-service): menu item list 로직 수정

- menu item list 얻어올 시 storeId가 없는것 까지 outer 조인으로 얻어오는 로직 수정
This commit is contained in:
hoon7566
2022-03-17 16:29:31 +09:00
parent 1918853791
commit 2186fed25a

View File

@@ -48,22 +48,22 @@ public class ItemRepositoryCustom {
Long count = queryFactory.select(QItem.item.count())
.from(QItem.item)
.join(QItem.item.category)
.leftJoin(QItem.item.store)
.on(QItem.item.store.userId.eq(userId))
.join(QItem.item.store)
.where(
QItem.item.name.contains(word)
.or(QItem.item.category.name.contains(word))
.or(QItem.item.category.name.contains(word)),
QItem.item.store.userId.eq(userId)
)
.fetchOne();
//List 가져오기
List<Item> itemList = queryFactory.selectFrom(QItem.item)
.join(QItem.item.category).fetchJoin()
.leftJoin(QItem.item.store)
.on(QItem.item.store.id.eq(userId))
.join(QItem.item.store)
.where(
QItem.item.name.contains(word)
.or(QItem.item.category.name.contains(word))
.or(QItem.item.category.name.contains(word)),
QItem.item.store.userId.eq(userId)
)
.limit(pageable.getPageSize())
.offset(pageable.getOffset())