提现限制

This commit is contained in:
Billy 2025-11-20 18:47:22 +08:00
parent 9e98a4fafc
commit 18e52067ee
2 changed files with 25 additions and 0 deletions

View File

@ -233,6 +233,16 @@ class Withdraw
if ($withdraw->status != 1) {
throw new ShoproException('请勿重复操作');
}
// 检查7天限制
if (isset($this->config['days_7']) && $this->config['days_7'] == 1) {
$daysDiff = (time() - $withdraw->createtime) / 86400; // 86400秒 = 1天
if ($daysDiff < 7) {
$remainingDays = ceil(7 - $daysDiff);
throw new ShoproException('提现申请时间未超过7天还需等待' . $remainingDays . '天才能放款');
}
}
if ($withdraw->withdraw_type !== 'bank') {
$withDrawStatus = $this->handleTransfer($withdraw);
} else {

View File

@ -631,6 +631,21 @@
<template #append></template>
</el-input>
</el-form-item>
<el-form-item label="限制7天后才能提现打款">
<div>
<div class="sa-flex">
<el-switch v-model="form.model.withdraw.days_7" class="sa-m-r-8"
:active-value="1" :inactive-value="0"></el-switch>
<div class="label-tip"
:class="form.model.withdraw.days_7 == 1?'sa-color--primary':''">
{{form.model.withdraw.days_7 == 1?'开启':'关闭'}}
</div>
</div>
<div class="tip">
开启后如果提现申请时间没有超过7天是不能放款的
</div>
</div>
</el-form-item>
</template>
</template>