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 = [