From 4be072c63b134163041312e860333366bd97dcc1 Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Thu, 12 Jun 2025 16:00:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=BD=E5=AE=B6seeder?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- database/seeds/SysCountryInit.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 database/seeds/SysCountryInit.php diff --git a/database/seeds/SysCountryInit.php b/database/seeds/SysCountryInit.php new file mode 100644 index 00000000..e3849645 --- /dev/null +++ b/database/seeds/SysCountryInit.php @@ -0,0 +1,30 @@ + 1, "name" => "中国", "en_name" => "China", "code" => "ZH", "icon" => null, "status" => 1, "sort" => 1, "created_at" => "2025-01-04 14:04:27", "updated_at" => "2025-03-14 11:52:17"], + ["id" => 2, "name" => "美国", "en_name" => "USA", "code" => "US", "icon" => null, "status" => 1, "sort" => 2, "created_at" => "2025-03-25 13:45:51", "updated_at" => "2025-04-07 11:54:43"] + ]; + + $table = $this->table('sys_country'); + + // empty the table + $table->truncate(); + + // insert data + $table->insert($data)->saveData(); + } +} \ No newline at end of file