39 lines
1.0 KiB
PHP
39 lines
1.0 KiB
PHP
<?php
|
|
|
|
use think\facade\Env;
|
|
use think\migration\Seeder;
|
|
|
|
class PlatformInit extends Seeder
|
|
{
|
|
/**
|
|
* Run Method.
|
|
*
|
|
* Write your database seeder using this method.
|
|
*
|
|
* More information on writing seeders is available here:
|
|
* http://docs.phinx.org/en/latest/seeding.html
|
|
*/
|
|
public function run()
|
|
{
|
|
$data = [
|
|
[
|
|
"id" => 1,
|
|
"name" => Env::get('platform_name'),
|
|
"vi_color1" => "#1233ab",
|
|
"vi_color2" => "#1231cd",
|
|
"vi_color3" => "#1112ef",
|
|
"language_id" => 1,
|
|
"currency_id" => 1,
|
|
"desc" => "",
|
|
"icon" => "",
|
|
"sort" => 1,
|
|
"status" => 0,
|
|
"create_time" => time(),
|
|
"update_time" => time()
|
|
]
|
|
];
|
|
|
|
$table = $this->table('platform');
|
|
$table->insert($data)->saveData();
|
|
}
|
|
} |