- 基础环境:Docker 部署配置,源码挂载实时同步 - 修复:super_admin 权限补全、登录重定向循环 - 开发:店铺营销账户账单 - 抖音账户(15字段汇总账单) - 开发:店铺营销账户账单 - 淘系支付宝账户(8字段流水账单) - 开发:店铺营销账户账单 - 拼多多账户(7字段流水账单) - 业务页面导航集成:config/business_navigation.php + Business\Pages 控制器 - 各平台独立表结构和视图,互不影响
77 lines
2.4 KiB
PHP
77 lines
2.4 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeds;
|
|
|
|
use App\Abstracts\Model;
|
|
use App\Jobs\Common\CreateReport;
|
|
use App\Traits\Jobs;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class Reports extends Seeder
|
|
{
|
|
use Jobs;
|
|
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
Model::unguard();
|
|
|
|
$this->create();
|
|
|
|
Model::reguard();
|
|
}
|
|
|
|
private function create()
|
|
{
|
|
$company_id = $this->command->argument('company');
|
|
|
|
$rows = [
|
|
[
|
|
'company_id' => $company_id,
|
|
'class' => \App\Reports\IncomeSummary::class,
|
|
'name' => trans('reports.income_summary'),
|
|
'description' => trans('demo.reports.income'),
|
|
'settings' => ['group' => 'category', 'period' => 'monthly', 'basis' => 'accrual'],
|
|
],
|
|
[
|
|
'company_id' => $company_id,
|
|
'class' => \App\Reports\ExpenseSummary::class,
|
|
'name' => trans('reports.expense_summary'),
|
|
'description' => trans('demo.reports.expense'),
|
|
'settings' => ['group' => 'category', 'period' => 'monthly', 'basis' => 'accrual'],
|
|
],
|
|
[
|
|
'company_id' => $company_id,
|
|
'class' => \App\Reports\IncomeExpenseSummary::class,
|
|
'name' => trans('reports.income_expense_summary'),
|
|
'description' => trans('demo.reports.income_expense'),
|
|
'settings' => ['group' => 'category', 'period' => 'monthly', 'basis' => 'accrual'],
|
|
],
|
|
[
|
|
'company_id' => $company_id,
|
|
'class' => \App\Reports\ProfitLoss::class,
|
|
'name' => trans('reports.profit_loss'),
|
|
'description' => trans('demo.reports.profit_loss'),
|
|
'settings' => ['group' => 'category', 'period' => 'quarterly', 'basis' => 'accrual', 'show_percentage' => 'no'],
|
|
],
|
|
[
|
|
'company_id' => $company_id,
|
|
'class' => \App\Reports\TaxSummary::class,
|
|
'name' => trans('reports.tax_summary'),
|
|
'description' => trans('demo.reports.tax'),
|
|
'settings' => ['period' => 'quarterly', 'basis' => 'accrual'],
|
|
],
|
|
];
|
|
|
|
foreach ($rows as $row) {
|
|
$row['created_from'] = 'core::seed';
|
|
|
|
$this->dispatch(new CreateReport($row));
|
|
}
|
|
}
|
|
}
|