Skip to content

Commit

Permalink
fix(核心): 修复 TS+ 充值的时候最小金额未使用后台配置问题 fixed #427
Browse files Browse the repository at this point in the history
  • Loading branch information
medz committed Nov 23, 2018
1 parent 1131567 commit b9b153d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/Http/Requests/API2/StoreTransform.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,15 @@ public function authorize(): bool
public function rules(): array
{
$currency = $this->user()->newWallet()->firstOrCreate([], ['balance' => 0, 'total_income' => 0, 'total_expenses' => 0]);
$min = setting('currency', 'settings', ['recharge-min' => 100])['recharge-min'];

return [
'amount' => 'required|int|min:100|max:'.$currency->balance,
'amount' => [
'required',
'integer',
sprintf('min:%d', $min),
sprintf('max:%d', $currency->balance),
],
];
}

Expand Down

0 comments on commit b9b153d

Please sign in to comment.