Stock.php 724 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\common\model;
  3. /**
  4. * @property number $num
  5. */
  6. class Stock extends Base
  7. {
  8. protected $schema = [
  9. 'id' => 'int', // id
  10. 'repo_id' => 'int', // 仓库ID
  11. 'good_id' => 'int', // 物品ID
  12. 'create_time' => 'datetime', // 创建时间
  13. 'update_time' => 'datetime', // 更新时间
  14. 'delete_time' => 'datetime', // 删除时间
  15. 'valid' => 'tinyint', // 状态,1启用,0禁用
  16. 'num' => 'float', // 数量
  17. ];
  18. public function repo()
  19. {
  20. return $this->belongsTo(Repo::class);
  21. }
  22. public function good()
  23. {
  24. return $this->belongsTo(Good::class);
  25. }
  26. }