init: 项目初始代码
This commit is contained in:
86
database/seeds/SiteCurrencyInit.php
Normal file
86
database/seeds/SiteCurrencyInit.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
use think\migration\Seeder;
|
||||
|
||||
class SiteCurrencyInit 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" => null,
|
||||
"platform_id" => 1,
|
||||
"currency_id" => 1,
|
||||
"create_time" => time(),
|
||||
"update_time" => time()
|
||||
],
|
||||
[
|
||||
"id" => null,
|
||||
"platform_id" => 1,
|
||||
"currency_id" => 2,
|
||||
"create_time" => time(),
|
||||
"update_time" => time()
|
||||
],
|
||||
[
|
||||
"id" => null,
|
||||
"platform_id" => 1,
|
||||
"currency_id" => 3,
|
||||
"create_time" => time(),
|
||||
"update_time" => time()
|
||||
],
|
||||
[
|
||||
"id" => null,
|
||||
"platform_id" => 1,
|
||||
"currency_id" => 4,
|
||||
"create_time" => time(),
|
||||
"update_time" => time()
|
||||
],
|
||||
[
|
||||
"id" => null,
|
||||
"platform_id" => 1,
|
||||
"currency_id" => 5,
|
||||
"create_time" => time(),
|
||||
"update_time" => time()
|
||||
],
|
||||
[
|
||||
"id" => null,
|
||||
"platform_id" => 1,
|
||||
"currency_id" => 5,
|
||||
"create_time" => time(),
|
||||
"update_time" => time()
|
||||
],
|
||||
[
|
||||
"id" => null,
|
||||
"platform_id" => 1,
|
||||
"currency_id" => 6,
|
||||
"create_time" => time(),
|
||||
"update_time" => time()
|
||||
],
|
||||
[
|
||||
"id" => null,
|
||||
"platform_id" => 1,
|
||||
"currency_id" => 7,
|
||||
"create_time" => time(),
|
||||
"update_time" => time()
|
||||
],
|
||||
[
|
||||
"id" => null,
|
||||
"platform_id" => 1,
|
||||
"currency_id" => 8,
|
||||
"create_time" => time(),
|
||||
"update_time" => time()
|
||||
]
|
||||
];
|
||||
$table = $this->table('platform_coin');
|
||||
$table->insert($data)->saveData();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user