正在显示
1 个修改的文件
包含
12 行增加
和
10 行删除
@@ -111,16 +111,18 @@ class WithdrawalController extends AdminBaseController{ | @@ -111,16 +111,18 @@ class WithdrawalController extends AdminBaseController{ | ||
111 | public function withd_through(){ | 111 | public function withd_through(){ |
112 | 112 | ||
113 | $money_expend = Db::name('money_expend') -> where('id',$_POST['id']) -> find(); | 113 | $money_expend = Db::name('money_expend') -> where('id',$_POST['id']) -> find(); |
114 | - $third_party = Db::name('third_party_user') -> where('user_id',$money_expend['uid']) -> find(); | ||
115 | - $result = $this -> merchantPay($third_party['openid'],'',$money_expend['money'],'企业付款'); | ||
116 | - if($result['result_code'] == 'SUCCESS'){ | ||
117 | - $create_time = time(); | ||
118 | - Db::name('money_expend') -> where('id',$_POST['id']) -> update(['state'=>1,'create_time'=>$create_time]); | ||
119 | - $money_expend['money'] = $money_expend['money']/(1-0.006); | ||
120 | - Db::name('my_user') -> where('uid',$money_expend['uid']) -> setDec('balance',$money_expend['money']); | ||
121 | - return true; | ||
122 | - }else{ | ||
123 | - return false; | 114 | + if($money_expend['state'] == 0) { |
115 | + $third_party = Db::name('third_party_user') -> where('user_id',$money_expend['uid']) -> find(); | ||
116 | + $result = $this -> merchantPay($third_party['openid'],'',$money_expend['money'],'企业付款'); | ||
117 | + if($result['result_code'] == 'SUCCESS'){ | ||
118 | + $create_time = time(); | ||
119 | + Db::name('money_expend') -> where('id',$_POST['id']) -> update(['state'=>1,'create_time'=>$create_time]); | ||
120 | + $money_expend['money'] = $money_expend['money']/(1-0.006); | ||
121 | + Db::name('my_user') -> where('uid',$money_expend['uid']) -> setDec('balance',$money_expend['money']); | ||
122 | + return true; | ||
123 | + }else{ | ||
124 | + return false; | ||
125 | + } | ||
124 | } | 126 | } |
125 | 127 | ||
126 | } | 128 | } |
-
请 注册 或 登录 后发表评论