단가 기간이 겹칠 때 최신 등록 단가를 우선 적용한다.
단가 조회 공통 로직을 모델로 통합하고 발주·판매·주문·사이트 화면의 단가 계산이 모두 최신 등록 순서(bp_regdate, bp_idx DESC)를 따르도록 맞춘다. Made-with: Cursor
This commit is contained in:
@@ -105,7 +105,7 @@ class ShopOrder extends BaseController
|
||||
}
|
||||
$qty = (int) $qtys[$i];
|
||||
|
||||
$price = model(BagPriceModel::class)->where('bp_lg_idx', $lgIdx)->where('bp_bag_code', $code)->where('bp_state', 1)->first();
|
||||
$price = model(BagPriceModel::class)->latestActiveByBagCode($lgIdx, (string) $code);
|
||||
$unitPrice = $price ? (float) $price->bp_consumer : 0;
|
||||
$amount = $unitPrice * $qty;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user