作者 lihan
1 个管道 的构建 通过 耗费 0 秒

确认收货

... ... @@ -116,15 +116,15 @@ class PayController extends HomeBaseController
}
} //组合支付
elseif ($order['pay_type'] == 2) {
$pay_cash = (int)($request->param('pay_cash')); //支付的金额
$pay_num = (int)($request->param('pay_num')); //支付的积分
$balance = (int)(Db::name('user')->where(['id' => session('user.id')])->value('balance'));
$pay_cash = $request->param('pay_cash'); //支付的金额
$pay_num = $request->param('pay_num'); //支付的积分
$balance = Db::name('user')->where(['id' => session('user.id')])->value('balance');
if ($pay_cash > $balance) {
$this->success('您的积分不足', '', false);
} else {
//先减余额
$balance -= $pay_num;
Db::name('user')->update(['id' => session('user.id'), 'balance' => $balance]);
Db::name('user')->update(['id' => session('user.id'), 'balance' => (int)$balance]);
Db::commit();
session('goods.id', null);
Db::name('zj_cart')->where(['id' => ['in', session('cart.id')]])->delete();
... ... @@ -133,7 +133,7 @@ class PayController extends HomeBaseController
'attach' => $oid,
'openid' => session('user.openid'),
'body' => '微信支付-天生红商城',
'total_fee' => 1
'total_fee' => (int)$pay_cash
];
$this->wxPay($info);
}
... ...