测试: 完成游戏娱乐模块 (Gomoku, HorseRace, Lottery 等) 功能全量联调测试与代码格式化
This commit is contained in:
@@ -24,21 +24,12 @@ class UserFactory extends Factory
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => fake()->name(),
|
||||
'username' => fake()->unique()->name(),
|
||||
'email' => fake()->unique()->safeEmail(),
|
||||
'email_verified_at' => now(),
|
||||
'password' => static::$password ??= Hash::make('password'),
|
||||
'remember_token' => Str::random(10),
|
||||
'sex' => 1,
|
||||
'user_level' => 1,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate that the model's email address should be unverified.
|
||||
*/
|
||||
public function unverified(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'email_verified_at' => null,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ return new class extends Migration
|
||||
['name' => '🌧️ 下雨周卡', 'slug' => 'week_rain', 'description' => '7天内进房间自动下雨', 'icon' => '🌧️', 'price' => 8888, 'type' => 'duration', 'duration_days' => 7, 'sort_order' => 6, 'is_active' => true, 'created_at' => now(), 'updated_at' => now()],
|
||||
['name' => '⚡ 雷电周卡', 'slug' => 'week_lightning', 'description' => '7天内进房间自动雷电', 'icon' => '⚡', 'price' => 8888, 'type' => 'duration', 'duration_days' => 7, 'sort_order' => 7, 'is_active' => true, 'created_at' => now(), 'updated_at' => now()],
|
||||
['name' => '❄️ 下雪周卡', 'slug' => 'week_snow', 'description' => '7天内进房间自动下雪', 'icon' => '❄️', 'price' => 8888, 'type' => 'duration', 'duration_days' => 7, 'sort_order' => 8, 'is_active' => true, 'created_at' => now(), 'updated_at' => now()],
|
||||
['name' => '✏️ 改名卡', 'slug' => 'rename_card', 'description' => '修改一次用户名(受黑名单限制)', 'icon' => '✏️', 'price' => 5000, 'type' => 'rename', 'duration_days' => null, 'sort_order' => 9, 'is_active' => true, 'created_at' => now(), 'updated_at' => now()],
|
||||
['name' => '✏️ 改名卡', 'slug' => 'rename_card', 'description' => '修改一次用户名(受黑名单限制)', 'icon' => '✏️', 'price' => 5000, 'type' => 'one_time', 'duration_days' => null, 'sort_order' => 9, 'is_active' => true, 'created_at' => now(), 'updated_at' => now()],
|
||||
]);
|
||||
|
||||
// ── 购买记录表 ────────────────────────────────────────────────
|
||||
|
||||
@@ -67,7 +67,7 @@ return new class extends Migration
|
||||
|
||||
// 联合唯一索引:每个用户每条反馈只能赞同一次
|
||||
$table->unique(['feedback_id', 'user_id'], 'uq_vote');
|
||||
$table->index('feedback_id', 'idx_feedback_id');
|
||||
$table->index('feedback_id');
|
||||
});
|
||||
|
||||
// ——— 表3:补充评论 ———
|
||||
@@ -83,7 +83,7 @@ return new class extends Migration
|
||||
$table->boolean('is_admin')->default(false)->comment('是否为 id=1 管理员的官方回复');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index('feedback_id', 'idx_feedback_id');
|
||||
$table->index('feedback_id');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user