All checks were successful
ERP-Deploy-Demo / deploy-demo (push) Successful in 1m5s
69 lines
2.1 KiB
PHP
69 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class SystemSettingSeeder extends Seeder
|
|
{
|
|
public function run(): void
|
|
{
|
|
$settings = [
|
|
// 💰 財務設定
|
|
[
|
|
'group' => 'finance',
|
|
'key' => 'finance.ap_payment_days',
|
|
'value' => '30',
|
|
'type' => 'integer',
|
|
'description' => '應付帳款預設付款天數',
|
|
],
|
|
// 📦 庫存管理
|
|
[
|
|
'group' => 'inventory',
|
|
'key' => 'inventory.expiry_warning_days',
|
|
'value' => '30',
|
|
'type' => 'integer',
|
|
'description' => '商品到期預警天數',
|
|
],
|
|
// 📊 周轉率分析
|
|
[
|
|
'group' => 'turnover',
|
|
'key' => 'turnover.analysis_period_days',
|
|
'value' => '30',
|
|
'type' => 'integer',
|
|
'description' => '周轉率分析:銷售統計期間(天)',
|
|
],
|
|
[
|
|
'group' => 'turnover',
|
|
'key' => 'turnover.dead_stock_days',
|
|
'value' => '90',
|
|
'type' => 'integer',
|
|
'description' => '周轉率分析:滯銷判定天數',
|
|
],
|
|
[
|
|
'group' => 'turnover',
|
|
'key' => 'turnover.slow_moving_days',
|
|
'value' => '60',
|
|
'type' => 'integer',
|
|
'description' => '周轉率分析:週轉慢判定天數',
|
|
],
|
|
// 🖥️ 顯示設定
|
|
[
|
|
'group' => 'display',
|
|
'key' => 'display.per_page',
|
|
'value' => '10',
|
|
'type' => 'integer',
|
|
'description' => '每頁預設筆數',
|
|
],
|
|
];
|
|
|
|
foreach ($settings as $setting) {
|
|
\App\Modules\Core\Models\SystemSetting::updateOrCreate(
|
|
['key' => $setting['key']],
|
|
$setting
|
|
);
|
|
}
|
|
}
|
|
}
|