From 2afea875aef65aa43971ac8b52953ce584e122bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwanyongkang=E2=80=9D?= <“937888580@qq.com”> Date: Thu, 3 Apr 2025 14:46:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B0=B4=E6=BB=B4=E8=BF=94=E6=AC=BE=20-?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/controller/Alipay.php | 7 +++++-- app/common/controller/Wxpay.php | 7 +++++-- app/jinyou/controller/Jinyoujt.php | 8 ++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/common/controller/Alipay.php b/app/common/controller/Alipay.php index f61f848..f728589 100644 --- a/app/common/controller/Alipay.php +++ b/app/common/controller/Alipay.php @@ -179,10 +179,13 @@ class Alipay { if($agent_info['discount_id'] != 0){ $scheme_model = new ProductPriceScheme(); - //获取代理折扣 - $discount = $scheme_model->getOne(['discount_id' => $agent_info['discount_id']]); + //获取代理折扣 + $discount = $scheme_model->getOne(['Id' => $agent_info['discount_id']]); $price = $package_info['LinePrice'] * $discount['discount'] / 100; + if ($price < $package_info['MinPrice']) { + $price = $package_info['MinPrice']; + } $score_money = $order_info['PaymentAmount'] - $order_info['ConnectCount'] * $order_info['AccountCount'] * $price; } diff --git a/app/common/controller/Wxpay.php b/app/common/controller/Wxpay.php index fbe35db..202b768 100644 --- a/app/common/controller/Wxpay.php +++ b/app/common/controller/Wxpay.php @@ -160,10 +160,13 @@ class Wxpay { if($agent_info['discount_id'] != 0){ $scheme_model = new ProductPriceScheme(); - //获取代理折扣 - $discount = $scheme_model->getOne(['discount_id' => $agent_info['discount_id']]); + //获取代理折扣 + $discount = $scheme_model->getOne(['Id' => $agent_info['discount_id']]); $price = $package_info['LinePrice'] * $discount['discount'] / 100; + if ($price < $package_info['MinPrice']) { + $price = $package_info['MinPrice']; + } $score_money = $order_info['PaymentAmount'] - $order_info['ConnectCount'] * $order_info['AccountCount'] * $price; } diff --git a/app/jinyou/controller/Jinyoujt.php b/app/jinyou/controller/Jinyoujt.php index d326e41..518dc06 100644 --- a/app/jinyou/controller/Jinyoujt.php +++ b/app/jinyou/controller/Jinyoujt.php @@ -259,13 +259,17 @@ class Jinyoujt extends Controller if($agent_info['discount_id'] != 0){ $scheme_model = new ProductPriceScheme(); - //获取代理折扣 - $discount = $scheme_model->getOne(['discount_id' => $agent_info['discount_id']]); + //获取代理折扣 + $discount = $scheme_model->getOne(['Id' => $agent_info['discount_id']]); $price = $package_info['LinePrice'] * $discount['discount'] / 100; + if ($price < $package_info['MinPrice']) { + $price = $package_info['MinPrice']; + } $score_money = $order_info['PaymentAmount'] - $order_info['ConnectCount'] * $order_info['AccountCount'] * $price; } + $score_model = new AgentScoreModel(); $score_data = [