mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-21 22:55:36 +00:00
31 lines
768 B
PHP
31 lines
768 B
PHP
<?php
|
|
|
|
use think\facade\Db;
|
|
use think\migration\Migrator;
|
|
|
|
class Version206 extends Migrator
|
|
{
|
|
/**
|
|
* @throws Throwable
|
|
*/
|
|
public function up(): void
|
|
{
|
|
$exist = Db::name('config')->where('name', 'backend_entrance')->value('id');
|
|
if (!$exist) {
|
|
$rows = [
|
|
[
|
|
'name' => 'backend_entrance',
|
|
'group' => 'basics',
|
|
'title' => 'Backend entrance',
|
|
'type' => 'string',
|
|
'value' => '/admin',
|
|
'rule' => 'required',
|
|
'weigh' => 1,
|
|
],
|
|
];
|
|
$table = $this->table('config');
|
|
$table->insert($rows)->saveData();
|
|
}
|
|
}
|
|
}
|