Files
chatroom/database/seeders/AutoFishingCardSeeder.php

80 lines
2.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* 文件功能:初始化自动钓鱼卡商品数据
*
* 共 3 档2小时卡、8小时卡、24小时卡。
* 激活后钓鱼无需手动点击浮漂,系统自动收竿。
* 可重复运行updateOrCreate 幂等)。
*/
namespace Database\Seeders;
use App\Models\ShopItem;
use Illuminate\Database\Seeder;
class AutoFishingCardSeeder extends Seeder
{
/**
* 写入 3 档自动钓鱼卡数据。
*/
public function run(): void
{
$cards = [
[
'slug' => 'auto_fishing_2h',
'name' => '自动钓鱼卡2小时',
'icon' => '🎣',
'description' => '激活后2小时内钓鱼无需手动点击浮漂系统自动收竿。',
'price' => 800,
'type' => 'auto_fishing',
'duration_minutes' => 120,
'sort_order' => 201,
'is_active' => true,
],
[
'slug' => 'auto_fishing_8h',
'name' => '自动钓鱼卡8小时',
'icon' => '🎣',
'description' => '激活后8小时内钓鱼无需手动点击浮漂系统自动收竿。超值之选',
'price' => 2500,
'type' => 'auto_fishing',
'duration_minutes' => 480,
'sort_order' => 202,
'is_active' => true,
],
[
'slug' => 'auto_fishing_24h',
'name' => '自动钓鱼卡24小时',
'icon' => '🎣',
'description' => '激活后24小时内钓鱼无需手动点击浮漂系统自动收竿。重度钓鱼爱好者必备',
'price' => 6000,
'type' => 'auto_fishing',
'duration_minutes' => 1440,
'sort_order' => 203,
'is_active' => true,
],
[
'slug' => 'auto_fishing_72h',
'name' => '自动钓鱼卡72小时',
'icon' => '🎣',
'description' => '激活后72小时内钓鱼无需手动点击浮漂系统自动收竿。钓鱼大神终极之选',
'price' => 15000,
'type' => 'auto_fishing',
'duration_minutes' => 4320,
'sort_order' => 204,
'is_active' => true,
],
];
foreach ($cards as $card) {
ShopItem::updateOrCreate(
['slug' => $card['slug']],
$card
);
}
$this->command->info('✅ 3 张自动钓鱼卡已写入 shop_items。');
}
}