|
@@ -48,6 +48,11 @@ class ConfirmController extends CController{
|
|
|
$balance_log->amount = $amount;
|
|
|
$balance_log->save(true);
|
|
|
|
|
|
+ $order->charge_id = $input_data['id'];
|
|
|
+ $order->pay_channel = $input_data['channel'];
|
|
|
+ $order->status = 1;
|
|
|
+ $order->update(array('charge_id','pay_channel','status'),true);
|
|
|
+
|
|
|
echo 'success';
|
|
|
die();
|
|
|
|
|
@@ -63,6 +68,14 @@ class ConfirmController extends CController{
|
|
|
if($order->update(array('charge_id','pay_channel','status'),true)){
|
|
|
$list = new ARedisList('o2o_after_pay_success');
|
|
|
$list->push(json_encode($input_data));
|
|
|
+
|
|
|
+ //如果有余额支付 扣除用户余额
|
|
|
+ if($order->final_price>$order->pay_price){
|
|
|
+ $user_obj = RUser::get($order->user);
|
|
|
+ $user_obj->balance = $user_obj->balance-($order->final_price-$order->pay_price);
|
|
|
+ $user_obj->save();
|
|
|
+ }
|
|
|
+
|
|
|
echo 'success';
|
|
|
die();
|
|
|
}else{
|