|
@@ -11,8 +11,40 @@ class Recharge
|
|
|
/**
|
|
|
* 支付回调
|
|
|
*/
|
|
|
+ public function rechargepaysucc($orderId,$args){
|
|
|
+ $order = Db::name('pay_order')->where(array('pay_no'=>$orderId,'status'=>2))->find();
|
|
|
+
|
|
|
+ if( $order )
|
|
|
+ {
|
|
|
|
|
|
+ Db::startTrans();
|
|
|
+ //更新订单状态
|
|
|
+ $rs = Db::name('pay_order')->where(['id'=>$order['id']])->update(['status'=>1]);
|
|
|
+ if(!$rs){
|
|
|
+ Db::rollback();
|
|
|
+ filePut('[wallet][paySucc] pay_order update fail'.$orderId);
|
|
|
+ abort(500,'订单更新失败');
|
|
|
+ }
|
|
|
|
|
|
+ //先充值
|
|
|
+ $result = model('Wallet')->lockChangeAccountRemain($args['user_id'],'gold',$args['gold'],10, '金币充值:'.$orderId,'pay_order',$order['id']);
|
|
|
+ if($result['status']===false)
|
|
|
+ {
|
|
|
+ Db::rollback();
|
|
|
+ filePut('[wallet][paySucc]网银充值入账更新余额失败 recharge money fail'.$orderId.$result['msg']);
|
|
|
+ abort(500,'网银充值入账 model wallet recharge money fail');
|
|
|
+ }
|
|
|
+
|
|
|
+ Db::commit();
|
|
|
+
|
|
|
+
|
|
|
+ return true;
|
|
|
+ }else{
|
|
|
+ filePut('[wallet][paySucc]在线支付订单有误 '.$orderId);
|
|
|
+ abort(500,'model wallet fail');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
public function goldpaysucc($orderId,$args){
|
|
|
$order = Db::name('pay_order')->where(array('pay_no'=>$orderId,'status'=>2))->find();
|