手续费读取

pull/1/head
limu 10 months ago
parent 832256285a
commit cbb467a725
  1. 12
      app/api/model/Setting.php
  2. 8
      app/api/model/dealer/Withdraw.php

@ -46,6 +46,18 @@ class Setting extends SettingModel
return static::getItem(SettingEnum::TRADE)['order']['closeHours']; return static::getItem(SettingEnum::TRADE)['order']['closeHours'];
} }
/**
* 获取提现手续费(%)
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public static function getFinanceCommission()
{
return static::getItem(SettingEnum::TRADE)['finance_process'];
}
/** /**
* 获取充值设置 * 获取充值设置
* @return array * @return array

@ -72,6 +72,13 @@ class Withdraw extends WithdrawModel
if (!$this->validation($dealer, $data)) { if (!$this->validation($dealer, $data)) {
return false; return false;
} }
//手续费
if(empty($data['is_invoice'])){
$commission = \app\api\model\Setting::getFinanceCommission();
if (empty($commission)) {
$data['commission_price'] = bcmath($data['money'], $commission / 100, 2);
}
}
// 事务处理 // 事务处理
$this->transaction(function () use ($dealer, $data) { $this->transaction(function () use ($dealer, $data) {
// 新增申请记录 // 新增申请记录
@ -143,6 +150,7 @@ class Withdraw extends WithdrawModel
$this->error = '请上传发票信息'; $this->error = '请上传发票信息';
return false; return false;
} }
return true; return true;
} }
} }

Loading…
Cancel
Save