Commit e8fbfd87 by 冷斌

fix bug

parent f73884cf
...@@ -181,7 +181,7 @@ class PayAction extends CommonAction ...@@ -181,7 +181,7 @@ class PayAction extends CommonAction
$this->error('支付类型错误'); $this->error('支付类型错误');
} }
$type = intval($_POST['user_vip']); $type = intval($_POST['user_vip']);
$vip = M('user_vip')->where('id=' . $type)->find(); $vip = M('user_vip')->where('id=' . $type)->find();
$vip_type_time = $_POST['vip_type_time']; $vip_type_time = $_POST['vip_type_time'];
...@@ -453,8 +453,8 @@ class PayAction extends CommonAction ...@@ -453,8 +453,8 @@ class PayAction extends CommonAction
'uid' => intval($this->mid), 'uid' => intval($this->mid),
'sid' => M('user')->where(['uid'=>$this->mid])->getField('mhm_id'), 'sid' => M('user')->where(['uid'=>$this->mid])->getField('mhm_id'),
'goods_id' => intval($_POST['goods_id']), 'goods_id' => intval($_POST['goods_id']),
'price' => 0,//intval($_POST['total']) - intval($fare), 'price' => $_POST['total'] - $fare,
'fare' => 0,//intval($fare), 'fare' => $fare,
'count' => intval($_POST['count']), 'count' => intval($_POST['count']),
'address_id' => intval($_POST['address_id']), 'address_id' => intval($_POST['address_id']),
//'lastPrice' =>intval($_POST['total'])+intval($_POST['fare']), //'lastPrice' =>intval($_POST['total'])+intval($_POST['fare']),
...@@ -630,7 +630,7 @@ class PayAction extends CommonAction ...@@ -630,7 +630,7 @@ class PayAction extends CommonAction
$this->assign('jumpUrl', U('classroom/Vip/index')); $this->assign('jumpUrl', U('classroom/Vip/index'));
} }
} }
//商户订单号 //商户订单号
$out_trade_no = $_GET['out_trade_no']; $out_trade_no = $_GET['out_trade_no'];
//支付宝交易号 //支付宝交易号
...@@ -715,7 +715,7 @@ class PayAction extends CommonAction ...@@ -715,7 +715,7 @@ class PayAction extends CommonAction
$data['status'] = 1; $data['status'] = 1;
$data['stime'] = time(); $data['stime'] = time();
$r_re = M('zy_recharge')->where(array('pay_pass_num' => $args['out_trade_no']))->save($data); $r_re = M('zy_recharge')->where(array('pay_pass_num' => $args['out_trade_no']))->save($data);
if (false == $r_re) { if (false == $r_re) {
echo json_encode(['status' => 0, 'info' => "修改购买记录状态失败"]); echo json_encode(['status' => 0, 'info' => "修改购买记录状态失败"]);
M()->rollback(); M()->rollback();
...@@ -726,12 +726,12 @@ class PayAction extends CommonAction ...@@ -726,12 +726,12 @@ class PayAction extends CommonAction
if (!$user || $args['money'] > $user['balance']) { if (!$user || $args['money'] > $user['balance']) {
echo json_encode(['status' => 0, 'info' => "你的余额不足,请及时充值"]);exit; echo json_encode(['status' => 0, 'info' => "你的余额不足,请及时充值"]);exit;
} }
$expire = 3600*24*30*$args['time']; $expire = 3600*24*30*$args['time'];
if($args['expire'] == 'year'){ if($args['expire'] == 'year'){
$expire = 3600*24*365*$args['time']; $expire = 3600*24*365*$args['time'];
} }
if( $user['vip_type'] == $args['vip_type']){ if( $user['vip_type'] == $args['vip_type']){
$user['vip_expire'] = $user['vip_expire']>time()?$user['vip_expire']+$expire:time()+$expire; $user['vip_expire'] = $user['vip_expire']>time()?$user['vip_expire']+$expire:time()+$expire;
}else{ }else{
...@@ -761,7 +761,7 @@ class PayAction extends CommonAction ...@@ -761,7 +761,7 @@ class PayAction extends CommonAction
echo json_encode(['status' => 0, 'info' => "流水添加失败"]); echo json_encode(['status' => 0, 'info' => "流水添加失败"]);
M()->rollback(); M()->rollback();
} }
//购买成功 //购买成功
if($f_re && $l_re && $r_re){ if($f_re && $l_re && $r_re){
echo json_encode(['status' => 1, 'info' => "购买成功"]); echo json_encode(['status' => 1, 'info' => "购买成功"]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment