CmsFloorTableSeeder.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. use Illuminate\Database\Seeder;
  3. use Illuminate\Support\Facades\DB;
  4. use Illuminate\Support\Carbon;
  5. class CmsFloorTableSeeder extends Seeder
  6. {
  7. /**
  8. * Run the database seeds.
  9. *
  10. * @return void
  11. */
  12. public function run()
  13. {
  14. $date = Carbon::now()->toDateTimeString();
  15. DB::table('cms_floor')->insert([
  16. [
  17. 'name' => '第一个floor',
  18. 'floor_location' => 1,
  19. 'group_ids' => '',
  20. 'floor_type' => 0,
  21. 'is_open' => 1,
  22. 'created_at' => $date,
  23. 'updated_at' => $date
  24. ],
  25. [
  26. 'name' => '第二个floor',
  27. 'floor_location' => 2,
  28. 'group_ids' => '',
  29. 'floor_type' => 1,
  30. 'is_open' => 1,
  31. 'created_at' => $date,
  32. 'updated_at' => $date
  33. ],
  34. [
  35. 'name' => '第三个floor',
  36. 'floor_location' => 3,
  37. 'group_ids' => '',
  38. 'floor_type' => 2,
  39. 'is_open' => 1,
  40. 'created_at' => $date,
  41. 'updated_at' => $date
  42. ],
  43. [
  44. 'name' => '第四个floor',
  45. 'floor_location' => 4,
  46. 'group_ids' => '',
  47. 'floor_type' => 3,
  48. 'is_open' => 1,
  49. 'created_at' => $date,
  50. 'updated_at' => $date
  51. ]
  52. ]);
  53. }
  54. }