|
@@ -45,11 +45,9 @@ class Takecash extends Api
|
|
|
}
|
|
|
|
|
|
//赋值money
|
|
|
- if($rc_id){
|
|
|
- $recharge_config = Db::name('take_cash_config')->where('id',$rc_id)->find();
|
|
|
- $money = $recharge_config['money'] ?: 0;
|
|
|
- $jewel = $recharge_config['jewel'] ?: 0;
|
|
|
- }
|
|
|
+ $recharge_config = Db::name('take_cash_config')->where('id',$rc_id)->find();
|
|
|
+ $money = $recharge_config['money'] ?: 0;
|
|
|
+ $jewel = $recharge_config['jewel'] ?: 0;
|
|
|
|
|
|
|
|
|
//
|
|
@@ -65,7 +63,7 @@ class Takecash extends Api
|
|
|
}
|
|
|
|
|
|
$user_money = model('wallet')->getwallet($this->auth->id,'jewel');
|
|
|
- if($money > $user_money){
|
|
|
+ if($jewel > $user_money){
|
|
|
$this->error('提现金额不能大于可提现余额');
|
|
|
}
|
|
|
|
|
@@ -83,11 +81,20 @@ class Takecash extends Api
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //平台手续费
|
|
|
+ $plat_bilv = $recharge_config['plat_bilv'];
|
|
|
+ $plat_money = bcdiv(bcmul($money,$plat_bilv,2),100,2);
|
|
|
+
|
|
|
+ //减去手续费,得实得金额
|
|
|
+ $get_money = bcsub($money,$plat_money,2);
|
|
|
|
|
|
$data = [
|
|
|
'user_id' => $this->auth->id,
|
|
|
- 'money' => $money,
|
|
|
'jewel' => $jewel,
|
|
|
+ 'money' => $money,
|
|
|
+ 'plat_bilv' => $plat_bilv,
|
|
|
+ 'plat_money' => $plat_money,
|
|
|
+ 'get_money' => $get_money,
|
|
|
'type' => $type,
|
|
|
'acount_json' => json_encode($account_json),
|
|
|
'createtime' => time(),
|