You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.0 KiB
PHP
49 lines
1.0 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class PushAdminData extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
$data = [
|
|
[
|
|
'hospital' => 0,
|
|
'account' => 'admin',
|
|
'nickname' => '超级管理员',
|
|
'password' => bcrypt('123465a'),
|
|
'admin_auth_id' => -1,
|
|
],
|
|
];
|
|
foreach ($data as $datum) {
|
|
$admin = new App\Models\Admin();
|
|
$admin->nickname = $datum['nickname'];
|
|
$admin->admin_auth_id = $datum['admin_auth_id'];
|
|
$admin->save();
|
|
$admin_account = new App\Models\AdminAccount();
|
|
$admin_account->admin_id = $admin->id;
|
|
$admin_account->account = $datum['account'];
|
|
$admin_account->secret = $datum['password'];
|
|
$admin_account->type = 1;
|
|
$admin_account->save();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
//
|
|
}
|
|
}
|