修复:佣金提现申请 驳回后,手续费未退还用户
This commit is contained in:
parent
90b1dcf440
commit
e593269708
|
|
@ -78,9 +78,11 @@ class UserExtractRepository extends BaseRepository
|
|||
* @author xaboy
|
||||
* @day 2020/6/22
|
||||
*/
|
||||
public function userTotalExtract($uid)
|
||||
{
|
||||
return $this->dao->search(['status' => [0,1], 'uid' => $uid])->sum('extract_price');
|
||||
public function userTotalExtract($uid){
|
||||
$totalExtractPrice = (float)$this->dao->search(['status' => [0,1], 'uid' => $uid])->sum('extract_price');
|
||||
$totalWithdrawCommission = (float)$this->dao->search(['status' => [0,1], 'uid' => $uid])->sum('withdraw_commission');
|
||||
|
||||
return (float)sprintf("%.2f",$totalExtractPrice + $totalWithdrawCommission);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -137,8 +139,7 @@ class UserExtractRepository extends BaseRepository
|
|||
$user = app()->make(UserRepository::class)->get($extract['uid']);
|
||||
if(!$user) throw new ValidateException('用户不存在');
|
||||
$brokerage_price = 0;
|
||||
if($data['status'] == -1)
|
||||
$brokerage_price = bcadd($user['brokerage_price'] ,$extract['extract_price'],2);
|
||||
if($data['status'] == -1) $brokerage_price = bcadd($user['brokerage_price'] ,bcadd($extract['extract_price'],$extract['withdraw_commission'],2),2);
|
||||
$type = systemConfig('sys_extension_type');
|
||||
$ret = [];
|
||||
$service = null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue