This commit is contained in:
make
2025-03-28 09:23:15 +08:00
parent 0fe90bebad
commit 13ca3ea6f9
180 changed files with 21659 additions and 53 deletions

View File

@@ -0,0 +1,60 @@
<?php
namespace database\seeders;
;
use app\model\TemplatesModel;
class TemplateSeeder
{
static public function handle()
{
$arrData = [
[
't_id' => 1,
't_default' => 1,
't_code' => 'default',
't_path' => '/app/home/view/default/',
],
[
't_id' => 2,
't_default' => 0,
't_code' => 'kuangYu',
't_path' => '/app/home/view/kuangYu/',
],
[
't_id' => 3,
't_default' => 0,
't_code' => 'haoZi',
't_path' => '/app/home/view/haoZi/',
],
[
't_id' => 4,
't_default' => 0,
't_code' => 'xiongMao',
't_path' => '/app/home/view/xiongMao/',
],
[
't_id' => 5,
't_default' => 0,
't_code' => 'shiKong',
't_path' => '/app/home/view/shiKong/',
],
];
foreach ($arrData as $arrSystemConfig) {
$TemplatesModel = TemplatesModel::where('t_id', $arrSystemConfig['t_id'])->find();
if (empty($TemplatesModel)) {
TemplatesModel::insert($arrSystemConfig);
}
}
TemplatesModel::flushCache();
}
}