From 5347670843d5660d5286d66bfc4d66d840fde821 Mon Sep 17 00:00:00 2001 From: fengxinyhyl Date: Tue, 26 Mar 2024 23:28:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BD=BF=E7=94=A8=E7=A7=AF?= =?UTF-8?q?=E5=88=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/order/StoreOrderCreateRepository.php | 7 +++++++ .../repositories/store/order/StoreOrderRepository.php | 1 + app/common/repositories/user/UserAssetsLogRepository.php | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/common/repositories/store/order/StoreOrderCreateRepository.php b/app/common/repositories/store/order/StoreOrderCreateRepository.php index 5140037..f685522 100644 --- a/app/common/repositories/store/order/StoreOrderCreateRepository.php +++ b/app/common/repositories/store/order/StoreOrderCreateRepository.php @@ -798,18 +798,25 @@ class StoreOrderCreateRepository extends StoreOrderRepository $merIntegralFlag = $merIntegralFlag || ((bool)$merIntegralConfig['mer_integral_status']); $integralFlag = $useIntegral && $sysIntegralConfig['integral_status'] && $sysIntegralConfig['integral_money'] > 0 && $merIntegralConfig['mer_integral_status']; + Log::info("***** integralflag {$integralFlag}". json_encode($sysIntegralConfig)); + Log::info("***** i". json_encode($merIntegralConfig)); + //计算积分抵扣 foreach ($merchantCart['list'] as &$cart) { //只有普通商品可以抵扣 + Log::info("****** {$cart['product_type']} {$userIntegral} ". json_encode($merchantCart)); if ($cart['product_type'] == 0 && $integralFlag && $userIntegral > 0 && $merchantCart['order']['true_price'] > 0) { $integralRate = $cart['product']['integral_rate']; + Log::info("*****0 ".$integralRate); if ($integralRate < 0) { $integralRate = $merIntegralConfig['mer_integral_rate']; } else if($integralRate > 0){ $integralRate = min(bcdiv($integralRate, 100, 4), 1); } + Log::info("*****1 ".$integralRate); if ($integralRate > 0) { $productIntegralPrice = min(bcmul(bcmul($this->cartByPrice($cart), $cart['cart_num'], 2), $integralRate, 2), $cart['true_price']); + Log::info("*****2 ".$productIntegralPrice); if ($productIntegralPrice > 0) { $productIntegral = ceil(bcdiv($productIntegralPrice, $sysIntegralConfig['integral_money'], 3)); if ($productIntegral <= $userIntegral) { diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index 78f20c2..5b2b9f8 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -1848,6 +1848,7 @@ class StoreOrderRepository extends BaseRepository }); event('order.verify', compact('order')); + event('order.take', compact('order')); } public function wxQrcode($orderId, $verify_code) diff --git a/app/common/repositories/user/UserAssetsLogRepository.php b/app/common/repositories/user/UserAssetsLogRepository.php index 74c1d1d..d1607be 100644 --- a/app/common/repositories/user/UserAssetsLogRepository.php +++ b/app/common/repositories/user/UserAssetsLogRepository.php @@ -524,7 +524,7 @@ class UserAssetsLogRepository extends BaseRepository $welfare = $huitong = $contribution = 0; // 1. 本人的消费积分 - if($orderItem['pay_price']){ + if(floatval($orderItem['pay_price']) > 0){ $logList[] = array( 'uid' => $orderItem['uid'], 'asset_type' => self::ASSET_TYPE_CONSUME,