refactor: 迁移彩票设置至 LotterySettings 服务
- 更新多个控制器和服务,使用 LotterySettings 服务获取彩票相关配置,如默认币种、开奖间隔、下注窗口等,提升代码一致性与可维护性。 - 移除 .env.example 中不再使用的配置项,建议通过后台管理进行设置。
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Lottery\ErrorCode;
|
||||
use App\Support\ApiResponse;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Services\LotterySettings;
|
||||
use App\Http\Controllers\Controller;
|
||||
|
||||
final class AdminCurrencyDestroyController extends Controller
|
||||
@@ -15,7 +16,7 @@ final class AdminCurrencyDestroyController extends Controller
|
||||
{
|
||||
$code = strtoupper((string) $currency->code);
|
||||
|
||||
if ($code === strtoupper((string) config('lottery.default_currency', 'NPR'))) {
|
||||
if ($code === LotterySettings::defaultCurrency()) {
|
||||
return ApiResponse::error(
|
||||
'默认币种不可删除',
|
||||
ErrorCode::ValidationFailed->value,
|
||||
|
||||
Reference in New Issue
Block a user