|
@@ -735,23 +735,28 @@ class UserCenter extends Base
|
|
|
if ($id){
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
- switch ($withdraw_type){
|
|
|
- case 'zfb':
|
|
|
- $zfb = new AliPay2();//实例化支付宝支付控制器
|
|
|
- $result = $zfb->FundTransToaccount($order_no, $user['zfb_account'], $user['zfb_real_name'], $real_money,'纪元部落余额提现');//调用支付宝支付的方法
|
|
|
+ //减少用户余额
|
|
|
+ $res = memberMoneyChange($money,3,$this->uid,'余额提现',0,$id);
|
|
|
+ if ($res){
|
|
|
+ switch ($withdraw_type){
|
|
|
+ case 'zfb':
|
|
|
+ $zfb = new AliPay2();//实例化支付宝支付控制器
|
|
|
+ $result = $zfb->FundTransToaccount($order_no, $user['zfb_account'], $user['zfb_real_name'], $real_money,'纪元部落余额提现');//调用支付宝支付的方法
|
|
|
// echo $result;die;
|
|
|
- if (!empty($result) && $result['code'] == 10000){
|
|
|
- Db::name('store_member_withdraw')->where('id',$id)->update(['paid'=>1,'pay_time'=>time(),'return_info'=>json_encode($result['result'],true)]);
|
|
|
- }else{
|
|
|
- Db::name('store_member_withdraw')->where('id',$id)->update(['return_info'=>json_encode($result['result'],true)]);
|
|
|
- Db::rollback();
|
|
|
- $this->error('提现失败,请检查绑定的支付宝信息');
|
|
|
- }
|
|
|
- break;
|
|
|
+ if (!empty($result) && $result['code'] == 10000){
|
|
|
+ Db::name('store_member_withdraw')->where('id',$id)->update(['paid'=>1,'pay_time'=>time(),'return_info'=>json_encode($result['result'],true)]);
|
|
|
+ }else{
|
|
|
+ Db::name('store_member_withdraw')->where('id',$id)->update(['return_info'=>json_encode($result['result'],true)]);
|
|
|
+ Db::rollback();
|
|
|
+ $this->error('提现失败,请检查绑定的支付宝信息');
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ Db::commit();
|
|
|
+ }else{
|
|
|
+ Db::rollback();
|
|
|
+ $this->error('提现失败,请稍后重试');
|
|
|
}
|
|
|
- //减少用户余额
|
|
|
- memberMoneyChange($money,3,$this->uid,'余额提现',0,$id);
|
|
|
- Db::commit();
|
|
|
CacheService::del($lock);
|
|
|
$this->success('提现成功');
|
|
|
}catch (Exception $e) {
|