ProductSeeder.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. namespace Database\Seeders\Backend;
  3. use Database\Seeders\BaseSeeder;
  4. use Illuminate\Support\Facades\Hash;
  5. use Txj\Elastic\Facades\Eav;
  6. use Txj\Elastic\Facades\ES;
  7. /**
  8. * 商品管理
  9. */
  10. class ProductSeeder extends BaseSeeder
  11. {
  12. public function getColumnData()
  13. {
  14. return [
  15. 'category_id' => ['type' => 'uBigint', 'title' => '产品分类'],
  16. 'title' => ['type' => 'string', 'title' => '商品标题'],
  17. 'domain_prefix' => ['type' => 'string', 'title' => '域名前缀'],
  18. 'logo' => ['type' => 'string', 'title' => '商品logo'],
  19. 'summary' => ['type' => 'text', 'title' => '简介'],
  20. 'desc' => ['type' => 'text', 'title' => '描述'],
  21. 'price1' => ['type' => 'decimal', 'length' => 8, 'decimal' => 2, 'title' => '月价格', 'is_null' => 0],
  22. 'price2' => ['type' => 'decimal', 'length' => 8, 'decimal' => 2, 'title' => '半年价格', 'is_null' => 0],
  23. 'price3' => ['type' => 'decimal', 'length' => 8, 'decimal' => 2, 'title' => '一年价格', 'is_null' => 0],
  24. 'price4' => ['type' => 'decimal', 'length' => 8, 'decimal' => 2, 'title' => '永久使用价格', 'is_null' => 0],
  25. 'price5' => ['type' => 'decimal', 'length' => 8, 'decimal' => 2, 'title' => '7天会员', 'is_null' => 0],
  26. 'market_price1' => ['type' => 'decimal', 'length' => 8, 'decimal' => 2, 'title' => '月价格', 'is_null' => 1],
  27. 'market_price2' => ['type' => 'decimal', 'length' => 8, 'decimal' => 2, 'title' => '半年价格', 'is_null' => 1],
  28. 'market_price3' => ['type' => 'decimal', 'length' => 8, 'decimal' => 2, 'title' => '一年价格', 'is_null' => 1],
  29. 'market_price4' => ['type' => 'decimal', 'length' => 8, 'decimal' => 2, 'title' => '永久使用价格', 'is_null' => 1],
  30. 'desc_price1' => ['type' => 'string', 'title' => '月价格', 'is_null' => 1],
  31. 'desc_price2' => ['type' => 'string', 'title' => '半年价格', 'is_null' => 1],
  32. 'desc_price3' => ['type' => 'string', 'title' => '一年价格', 'is_null' => 1],
  33. 'desc_price4' => ['type' => 'string', 'title' => '永久使用价格', 'is_null' => 1],
  34. 'desc_price5' => ['type' => 'string', 'title' => '七天会员标语', 'is_null' => 1],
  35. 'status' => ['type' => 'tinyint', 'title' => '状态', 'remark' => '1 上架 2 下架'],
  36. ];
  37. }
  38. /**
  39. * 初始化内容
  40. */
  41. public function init()
  42. {
  43. }
  44. /**
  45. * Run the database seeds.
  46. *
  47. * @return void
  48. */
  49. public function run()
  50. {
  51. $this->schema = 'product';
  52. $this->title = '产品表';
  53. $this->start();
  54. }
  55. }