add create:seed command

This commit is contained in:
uctoo
2021-06-06 15:57:50 +08:00
parent 72bf97579b
commit 22ad849900
3 changed files with 105 additions and 2 deletions

View File

@@ -6,12 +6,12 @@
// +----------------------------------------------------------------------
// | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// | Author: UCToo [ contact@uctoo.com ]
// +----------------------------------------------------------------------
use think\migration\Seeder;
class SeederClass extends Seeder
class {CLASS} extends Seeder
{
/**
* Run Method.
@@ -23,6 +23,10 @@ class SeederClass extends Seeder
*/
public function run()
{
$data = {DATA}
foreach ($data as $item) {
\catchAdmin\{MODULE}\model\{MODEL}::create($item);
}
}
}