refactor: 迁移彩票设置至 LotterySettings 服务
- 更新多个控制器和服务,使用 LotterySettings 服务获取彩票相关配置,如默认币种、开奖间隔、下注窗口等,提升代码一致性与可维护性。 - 移除 .env.example 中不再使用的配置项,建议通过后台管理进行设置。
This commit is contained in:
@@ -4,6 +4,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Support;
|
||||
|
||||
use App\Services\LotterySettings;
|
||||
|
||||
/**
|
||||
* 将「最小货币单位」整数格式化为展示用字符串(不改变业务数字,仅格式化)。
|
||||
*
|
||||
@@ -22,9 +24,9 @@ final class CurrencyFormatter
|
||||
|
||||
private static function formatMinorInt(int $minorUnits): string
|
||||
{
|
||||
$decimals = max(0, min(12, (int) config('lottery.ui.format.currency.decimals', 2)));
|
||||
$decSep = (string) config('lottery.ui.format.currency.decimal_separator', '.');
|
||||
$thousandsSep = (string) config('lottery.ui.format.currency.thousands_separator', ',');
|
||||
$decimals = LotterySettings::currencyDisplayDecimals();
|
||||
$decSep = LotterySettings::currencyDecimalSeparator();
|
||||
$thousandsSep = LotterySettings::currencyThousandsSeparator();
|
||||
|
||||
$divisor = (int) max(1, 10 ** $decimals);
|
||||
$negative = $minorUnits < 0;
|
||||
|
||||
Reference in New Issue
Block a user