...
|
...
|
@@ -603,10 +603,10 @@ class OrderController extends HomeBaseController{ |
|
|
// }
|
|
|
// }
|
|
|
//余额支付
|
|
|
if ($user['fee']>=$price){
|
|
|
if ($user['fee']>=$order['price']){
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
Db::name('users')->where('id', $user['id'])->setDec('fee',$price);
|
|
|
Db::name('users')->where('id', $user['id'])->setDec('fee',$order['price']);
|
|
|
Db::name('order')->where('id',$order['id'])->update(['state'=>3]);
|
|
|
Db::name('fee_log')->insert(['user_id'=>$user['id'],'fee'=>$price,'type'=>2,'add_time'=>time()]);
|
|
|
// 提交事务
|
...
|
...
|
@@ -618,7 +618,7 @@ class OrderController extends HomeBaseController{ |
|
|
}
|
|
|
$this->apiResponse(201, '余额支付成功');
|
|
|
}elseif ($user['fee']<$price){
|
|
|
Db::name('order')->where('id',$order['id'])->update(['group_money'=>($price-$user['fee'])]);
|
|
|
Db::name('order')->where('id',$order['id'])->update(['group_money'=>($order['price']-$user['fee'])]);
|
|
|
$body = '支付';
|
|
|
$notify_url = url('order/group', '', '', true);//回调地址
|
|
|
$out_trade_no = $param['order_no'] . $this->create_noncestr(4);
|
...
|
...
|
|