作者 刘朕
1 个管道 的构建 通过 耗费 43 秒

后台提现审核优化

... ... @@ -111,16 +111,18 @@ class WithdrawalController extends AdminBaseController{
public function withd_through(){
$money_expend = Db::name('money_expend') -> where('id',$_POST['id']) -> find();
$third_party = Db::name('third_party_user') -> where('user_id',$money_expend['uid']) -> find();
$result = $this -> merchantPay($third_party['openid'],'',$money_expend['money'],'企业付款');
if($result['result_code'] == 'SUCCESS'){
$create_time = time();
Db::name('money_expend') -> where('id',$_POST['id']) -> update(['state'=>1,'create_time'=>$create_time]);
$money_expend['money'] = $money_expend['money']/(1-0.006);
Db::name('my_user') -> where('uid',$money_expend['uid']) -> setDec('balance',$money_expend['money']);
return true;
}else{
return false;
if($money_expend['state'] == 0) {
$third_party = Db::name('third_party_user') -> where('user_id',$money_expend['uid']) -> find();
$result = $this -> merchantPay($third_party['openid'],'',$money_expend['money'],'企业付款');
if($result['result_code'] == 'SUCCESS'){
$create_time = time();
Db::name('money_expend') -> where('id',$_POST['id']) -> update(['state'=>1,'create_time'=>$create_time]);
$money_expend['money'] = $money_expend['money']/(1-0.006);
Db::name('my_user') -> where('uid',$money_expend['uid']) -> setDec('balance',$money_expend['money']);
return true;
}else{
return false;
}
}
}
... ...