...
|
...
|
@@ -588,6 +588,33 @@ class OrderController extends HomeBaseController{ |
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @title 余额支付
|
|
|
* @description
|
|
|
* @author sgj
|
|
|
* @url /portal/order/chargeOrder
|
|
|
* @method GET
|
|
|
*
|
|
|
* @param name:fee type:String require:1 default:无 other: desc:金额
|
|
|
* @param name:user_id type:String require:1 default:无 other: desc:用户id
|
|
|
*
|
|
|
* @return order:订单号
|
|
|
*/
|
|
|
public function payByBalance(){
|
|
|
$order_no=input('order_no');
|
|
|
$order_map['order_no']=$order_no;
|
|
|
$order=\db('order')->where($order_map)->find();
|
|
|
$user_map['id']=$order['users_id'];
|
|
|
$user=\db('users')->where($user_map)->find();
|
|
|
if ($order['price']>$user['fee']){
|
|
|
|
|
|
$this->apiResponse('400','余额不足!');
|
|
|
}
|
|
|
$result=\db('users')->where($user_map)->setDec('fee',$order['price']);
|
|
|
if ($result==1){
|
|
|
$this->apiResponse('200','支付成功!');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//支付回调接口
|
|
|
public function notify(){
|
...
|
...
|
|