Skip to content

Commit b9b153d

Browse files
committed
fix(核心): 修复 TS+ 充值的时候最小金额未使用后台配置问题 fixed #427
1 parent 1131567 commit b9b153d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

app/Http/Requests/API2/StoreTransform.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,15 @@ public function authorize(): bool
4343
public function rules(): array
4444
{
4545
$currency = $this->user()->newWallet()->firstOrCreate([], ['balance' => 0, 'total_income' => 0, 'total_expenses' => 0]);
46+
$min = setting('currency', 'settings', ['recharge-min' => 100])['recharge-min'];
4647

4748
return [
48-
'amount' => 'required|int|min:100|max:'.$currency->balance,
49+
'amount' => [
50+
'required',
51+
'integer',
52+
sprintf('min:%d', $min),
53+
sprintf('max:%d', $currency->balance),
54+
],
4955
];
5056
}
5157

0 commit comments

Comments
 (0)