WebNewsListSeeder.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace Database\Seeders\Frontend;
  3. use Database\Seeders\BaseSeeder;
  4. use Illuminate\Support\Facades\DB;
  5. use Illuminate\Support\Str;
  6. /**
  7. * 新闻列表
  8. *
  9. * Class BusinessSeeder
  10. * @package Database\Seeders
  11. */
  12. class WebNewsListSeeder extends BaseSeeder
  13. {
  14. public function getColumnData()
  15. {
  16. return [
  17. 'category_id' => ['type' => 'uBigint', 'title' => '分类ID', 'is_null' => 0],
  18. 'tag' => ['type' => 'string_20', 'title' => '英文标识,方便查询'],
  19. 'title' => ['type' => 'string', 'title' => '标题', 'is_null' => 0],
  20. 'logo' => ['type' => 'string', 'title' => '封面图'],
  21. 'introduction' => ['type' => 'string', 'title' => '简介'],
  22. 'content' => ['type' => 'text', 'title' => '内容'],
  23. 'status' => ['type' => 'tinyint', 'title' => '状态', 'remark' => '1使用 2禁用']
  24. ];
  25. }
  26. public function init()
  27. {
  28. // DB::table($this->schema)->insert([
  29. // 'mid' => Str::random(12),
  30. // 'category_id' => 1,
  31. // 'title' => '跳跳鱼科技',
  32. // 'logo' => '',
  33. // 'introduction' => '跳跳鱼科技',
  34. // 'content' => '跳跳鱼科技',
  35. // 'status' => 1,
  36. // 'created_at' => time(),
  37. // 'updated_at' => time()
  38. // ]);
  39. }
  40. /**
  41. * Run the database seeds.
  42. *
  43. * @return void
  44. */
  45. public function run()
  46. {
  47. $this->schema = 'web_news';
  48. $this->title = '新闻列表';
  49. $this->start();
  50. }
  51. }