修改订单红包金额分配的错误

This commit is contained in:
luofei 2024-01-29 14:03:35 +08:00
parent 66130c66d2
commit 665eb57c5e
3 changed files with 3 additions and 1 deletions

View File

@ -350,7 +350,7 @@ class StoreConsumptionUserDao extends BaseDao
$groupOrderTotalPrice = $this->groupOrderTotalPrice * 100;
$consumptionBalance = $this->consumptionTotalAmount * 100;
$rate = bcdiv($orderTotalPrice, $groupOrderTotalPrice, 5);
if ($consumptionBalance >= $orderTotalPrice) {
if ($consumptionBalance >= $groupOrderTotalPrice) {
$useAmount = $orderTotalPrice;
} else {
$useAmount = $this->isLast ? $consumptionBalance : ceil(bcmul($consumptionBalance, $rate, 5));

View File

@ -58,6 +58,7 @@ class StoreCartRepository extends BaseRepository
public function checkCartList($res, $hasCoupon = 0, $user = null)
{
$arr = $fail = [];
/** @var ProductRepository $product_make */
$product_make = app()->make(ProductRepository::class);
$svip_status = ($user && $user->is_svip > 0 && systemConfig('svip_switch_status')) ? true : false;
foreach ($res as $item) {

View File

@ -53,6 +53,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
$addressRepository = app()->make(UserAddressRepository::class);
$address = $addressRepository->getWhere(['uid' => $uid, 'address_id' => $addressId]);
}
/** @var StoreCartRepository $storeCartRepository */
$storeCartRepository = app()->make(StoreCartRepository::class);
$res = $storeCartRepository->checkCartList($storeCartRepository->cartIbByData($cartId, $uid, $address), 0, $user);
$merchantCartList = $res['list'];