This commit is contained in:
Hankin 2026-04-24 17:12:07 +08:00
parent 80903b9719
commit fea3ac2630

View File

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