|
|
|
@ -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',
|
|
|
|
|