Good.php 786 B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace app\common\model;
  3. class Good extends Base
  4. {
  5. protected $schema = [
  6. 'id' => 'int', // id
  7. 'no' => 'varchar', // 编号
  8. 'name' => 'varchar', // 物品名称
  9. 'desc' => 'varchar', // 物品介绍
  10. 'unit' => 'varchar', // 单位
  11. 'img' => 'varchar', // 图片
  12. 'create_time' => 'datetime', // 创建时间
  13. 'update_time' => 'datetime', // 更新时间
  14. 'delete_time' => 'datetime', // 删除时间
  15. 'valid' => 'tinyint', // 状态,1启用,0禁用
  16. 'spec' => 'varchar', // 规格
  17. 'good_class_id' => 'int', // 类别
  18. ];
  19. public function goodClass()
  20. {
  21. return $this->belongsTo(GoodClass::class);
  22. }
  23. }