123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- use Illuminate\Database\Seeder;
- class DictionarySeeder extends Seeder
- {
- /**
- * Run the database seeds.
- *
- * @return void
- */
- public function run()
- {
- $values = collect([1 => '未提交审核', 2 => '正在审核', 3 => '审核失败', 4 => '审核通过', 5 => '已发布']);
- foreach($values as $key => $value) {
- \App\Models\BaseDictionaryOptionModel::firstOrCreate([
- 'dictionary_table_code' => 'auth',
- 'dictionary_code' => 'status',
- 'key' => $key,
- 'value' => $key,
- 'name' => $value
- ]);
- }
- $values = collect([1 => '类型1', 2 => '类型2', 3 => '类型3', 4 => '类型4']);
- foreach($values as $key => $value) {
- \App\Models\BaseDictionaryOptionModel::firstOrCreate([
- 'dictionary_table_code' => 'template',
- 'dictionary_code' => 'type',
- 'key' => $key,
- 'value' => $key,
- 'name' => $value
- ]);
- }
- }
- }
|