支付意向

master
tping 5 years ago
parent e2c0f9d46e
commit 36cd355d75

@ -540,14 +540,17 @@ ADD COLUMN `pay_url` varchar(255) NOT NULL DEFAULT '' AFTER `check_sign`;
$user_token = I('request.user_token');
$pay_way = I('request.payway');
$game_id = I('request.game_id');
$user_id = I('request.user_id');
if (!$user_token) {
echo "access deny!";
die();
}
$userTokenInfo = M("user_token", "tab_")->where(array(
'user_token' => $user_token,
'game_id' => $game_id
))->getField("user_id");
$user_id = $userTokenInfo['user_id'];
// var_dump($game_id);die();
if (!$game_id) {
echo json_encode(['code'=>0,'msg'=>'参数错误']);
@ -591,32 +594,22 @@ ADD COLUMN `pay_url` varchar(255) NOT NULL DEFAULT '' AFTER `check_sign`;
exit;
}
$intentionLog = $payChannelIntention->where(array(
'pay_order_number' => $pay_info['order_id']
))->count();
$pay_intention_num = M('pay_intention_num','tab_')->field('num')->where(['pay_order_number' => $pay_info['order_id']])->find();
if ($pay_intention_num&&$pay_intention_num['num']>9) {
// 超过十条不做记录
echo json_encode(['code'=>200,'msg'=>'']);
exit;
}
// $user_info = M('user','tab_')->field('account')->where(['id'=>$user_id])->find();
$insert['user_id'] = $user_id;
$insert['user_account'] = $pay_info['user_account'];
$insert['pay_way'] = $pay_way;
$insert['pay_amount'] = $pay_info['price'];
$insert['pay_order_number'] = $pay_info['order_id'];
$insert['create_time'] = time();
$is_success = M('pay_channel_intention','tab_')->add($insert);
if ($is_success) {
if (!$pay_intention_num) {
M('pay_intention_num','tab_')->add(['num'=>1,'pay_order_number'=>$pay_info['order_id']]);
} else {

@ -116,7 +116,6 @@
</div>
</div>
<input style="display: none" id="user_token" value="{$_REQUEST['user_token']}">
<input style="display: none" id="user_id" value="{$_REQUEST['user_id']}">
<input style="display: none" id="game_id" value="{$_REQUEST['game_id']}">
<!-- 横屏 -->
<div class="payment_heng">
@ -244,12 +243,16 @@
function payChannelIntentionInit(user_token) {
var game_id = $('#game_id').val();
var user_id = $('#user_id').val();
$.ajax({
type:'post',
dataType:'json',
data:{user_token:user_token,payway:payway,game_id:game_id,user_id:user_id},
data:{
user_token:user_token,
payway:payway,
game_id:game_id
},
}
url:'/sdk.php/Spend/addPayChannelIntention',
success:function(result) {
if(result.code==0) {

Loading…
Cancel
Save