From b418c2ed53542fbe538afc8883c21cb6bd36f5e2 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 5 Nov 2019 14:33:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=85=E5=80=BC=E6=9C=AA=E4=BC=98=E5=85=88?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=B9=B3=E5=8F=B0=E5=B8=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sdk/Controller/SpendController.class.php | 13 +++++++------ Application/Sdk/View/default/Spend/pay_way.html | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Application/Sdk/Controller/SpendController.class.php b/Application/Sdk/Controller/SpendController.class.php index 5401122b..3d3f91e0 100644 --- a/Application/Sdk/Controller/SpendController.class.php +++ b/Application/Sdk/Controller/SpendController.class.php @@ -52,16 +52,15 @@ class SpendController extends Controller { die(); } $userId = M('user', 'tab_')->where(['user_token'=>$user_token])->getField('id'); - if ($userId != $user_id) { - echo "请重新登入!"; - die(); - } + // if ($userId != $user_id) { + // echo "请重新登入!"; + // die(); + // } C(BaseController::get_tool()); // pp(BaseController::get_tool()); $file = file_get_contents ( "./Application/Sdk/OrderNo/" . $user_id . "-" . $game_id . ".txt" ); $request = json_decode ( think_decrypt ( $file ), true ); - $data = array( 'coin' => $request ['body'], 'price' => $request ['price'], @@ -76,14 +75,15 @@ class SpendController extends Controller { 'game_id' => $game_id ) )->getField ( 'bind_balance' ); // $data['price'] = 1; - $this->assign ( 'balance', $balance ); $this->assign ( 'bind_balance', $bind_balance ); $this->assign ( 'data', $data ); $this->assign ( 'btncolor', $request ['btncolor'] ); if ($balance + $bind_balance > $data['price']) { + $apply_money = $data['price']; $this->assign ('pay_price', 0); // 是否第三方支付 } else { + $apply_money = $balance + $bind_balance; $payPrice = $data['price'] - $balance - $bind_balance; $this->assign ('pay_price', $payPrice ? $payPrice : 0); } @@ -98,6 +98,7 @@ class SpendController extends Controller { unset($data['pay_way']); /* if ($request['sdk_version'] == 1) // android 没有 is_create_ordernumer苹果内购 unset($data['is_create_ordernumer']); */ + $this->assign('apply_money',$apply_money); //适用平台金额 $this->assign('sdk_version', $request['sdk_version']); $this->assign('small_json', json_encode(array( 'appId' => 'wx8419130aa4ff123b', diff --git a/Application/Sdk/View/default/Spend/pay_way.html b/Application/Sdk/View/default/Spend/pay_way.html index 6060fc46..9db94d42 100644 --- a/Application/Sdk/View/default/Spend/pay_way.html +++ b/Application/Sdk/View/default/Spend/pay_way.html @@ -154,7 +154,7 @@

适用平台余额:

-
-¥{$balance+$bind_balance}
+
-¥{$apply_money}