transfer
This commit is contained in:
parent
80903b9719
commit
fea3ac2630
@ -563,7 +563,7 @@ class EarningController extends Controller
|
||||
$amount = $request->amount;
|
||||
if (!is_numeric($amount) || $amount <= 0)
|
||||
return $this->failure('请输入正确的提现金额');
|
||||
if ($amount < 1)
|
||||
if ($amount < 1 && $merchant_user_id != 221)
|
||||
return $this->failure('单笔提现最低金额为1元');
|
||||
$earning_account = MEarningAccount::where('m_id', $merchant_id)->where('m_user_id', $merchant_user_id)->first();
|
||||
if (empty($earning_account)) {
|
||||
@ -576,11 +576,15 @@ class EarningController extends Controller
|
||||
if ($earning_account->balance < $amount)
|
||||
return $this->failure('提现金额不能大于可以提现的总金额!');
|
||||
$trade_no = \CommonUtilsService::getTradeNO();
|
||||
$actual_received = $amount;
|
||||
if ($merchant_user_id != 221) {
|
||||
$poundage = Redis::get('withdrawal_poundage') ?? 2; //提现手续费百分比
|
||||
$poundage = $amount * ($poundage / 100) >= 0.01 ? $amount * ($poundage / 100) : 0.01;//收取手续费费用 不足1分 按一分处理
|
||||
$poundage = floor($poundage * 100) / 100;
|
||||
Log::info("amount:" . $amount . " & poundage:" . $poundage);
|
||||
$actual_received = $amount - $poundage;//实际到账金额
|
||||
}
|
||||
|
||||
//处理冻结金额
|
||||
DB::beginTransaction();
|
||||
$earning_account->balance = $earning_account->balance - $amount;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user