Skip to content

Commit fee4e0e

Browse files
fix(Customers): 등급 기준 변경 시 반영이 안되던 오류를 수정
반복문의 인덱스를 j가 아닌 i를 참조하던 것을 수정
1 parent 8cb91b0 commit fee4e0e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/main/java/me/smartstore/customer/Customers.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ public void refreshCustomersGroup() {
3232
int totalAmount = currentCustomer.getTotalAmount();
3333

3434
for (int j = 0; j < groupList.size() - 1; j++) {
35-
int currentMinimumHours = groupList.get(i).getParameter().getMinimumHours();
36-
int currentMinimumTotalAmount = groupList.get(i).getParameter().getMinimumTotalAmount();
37-
int nextMinimumHours = groupList.get(i + 1).getParameter().getMinimumHours();
38-
int nextMinimumTotalAmount = groupList.get(i + 1).getParameter().getMinimumTotalAmount();
35+
int currentMinimumHours = groupList.get(j).getParameter().getMinimumHours();
36+
int currentMinimumTotalAmount = groupList.get(j).getParameter().getMinimumTotalAmount();
37+
int nextMinimumHours = groupList.get(j + 1).getParameter().getMinimumHours();
38+
int nextMinimumTotalAmount = groupList.get(j + 1).getParameter().getMinimumTotalAmount();
3939
//어떤 기준도 충족 못시킬 때
4040
if (hours <= currentMinimumHours || totalAmount <= currentMinimumTotalAmount) {
41-
currentCustomer.setGroup(GroupType.getGroupType(0));
41+
currentCustomer.setGroup(GroupType.getGroupType(j));
4242
return;
4343
}
4444
if (hours <= nextMinimumHours && totalAmount <= nextMinimumTotalAmount) {
45-
currentCustomer.setGroup(GroupType.getGroupType(i));
45+
currentCustomer.setGroup(GroupType.getGroupType(j));
4646
return;
4747
}
4848
}

0 commit comments

Comments
 (0)