完善功能

This commit is contained in:
cjd
2026-02-07 22:55:07 +08:00
parent bf3a2e6971
commit ae7c009d28
111 changed files with 980 additions and 10111 deletions

View File

@@ -0,0 +1,43 @@
<?php
namespace Database\Seeders;
use App\Models\AdSlot;
use Illuminate\Database\Seeder;
class AdSlotSeeder extends Seeder
{
public function run(): void
{
$slots = [
[
'key' => 'home',
'name' => '首页推广位',
'description' => '首页内容区推广位',
'max_items' => 3,
'sort' => 0,
],
[
'key' => 'list',
'name' => '列表页推广位',
'description' => '列表/搜索/标签页推广位',
'max_items' => 3,
'sort' => 10,
],
[
'key' => 'detail',
'name' => '详情页推广位',
'description' => '产品/文章详情页推广位',
'max_items' => 3,
'sort' => 20,
],
];
foreach ($slots as $slot) {
AdSlot::updateOrCreate(
['key' => $slot['key']],
$slot
);
}
}
}