feat: enhance player authentication and agent management features
Some checks failed
lotterLaravel CI / test (push) Has been cancelled
Some checks failed
lotterLaravel CI / test (push) Has been cancelled
- Updated AGENTS.md to clarify player interface bindings and agent account restrictions. - Improved PlayerAuthLoginController to include captcha verification for player login. - Enhanced AdminPlayerIndexController with permission checks for admin users. - Refactored AdminPlayerStoreController to enforce agent node restrictions for non-super admins. - Introduced new error codes for player authentication failures and updated related services. - Enhanced validation rules for agent profiles to include settlement cycle options. - Improved AdminCaptchaService to support separate scopes for admin and player captcha handling. - Updated various services to ensure proper credit management and settlement processes.
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if (! Schema::hasTable('agent_nodes') || ! Schema::hasTable('agent_profiles')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$defaults = config('agent_line_defaults', []);
|
||||
$now = now();
|
||||
|
||||
$roots = DB::table('agent_nodes')->where('depth', 0)->get(['id']);
|
||||
|
||||
foreach ($roots as $root) {
|
||||
$nodeId = (int) $root->id;
|
||||
if (DB::table('agent_profiles')->where('agent_node_id', $nodeId)->exists()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
DB::table('agent_profiles')->insert([
|
||||
'agent_node_id' => $nodeId,
|
||||
'total_share_rate' => (float) ($defaults['total_share_rate'] ?? 100),
|
||||
'credit_limit' => (int) ($defaults['credit_limit'] ?? 0) > 0
|
||||
? (int) $defaults['credit_limit']
|
||||
: 1_000_000,
|
||||
'allocated_credit' => 0,
|
||||
'used_credit' => 0,
|
||||
'rebate_limit' => (float) ($defaults['rebate_limit'] ?? 0.005),
|
||||
'default_player_rebate' => (float) ($defaults['default_player_rebate'] ?? 0.005),
|
||||
'can_grant_extra_rebate' => true,
|
||||
'can_create_child_agent' => true,
|
||||
'can_create_player' => true,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
// 非破坏性:不回删已补档案。
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user