RepairDevice.php 642 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace App\Models;
  3. class RepairDevice extends BaseModel
  4. {
  5. public function parts()
  6. {
  7. return $this->hasMany('App\Models\Part', 'repair_device_id');
  8. }
  9. public function user()
  10. {
  11. return $this->belongsTo('App\Models\User', 'user_id');
  12. }
  13. public function project()
  14. {
  15. return $this->belongsTo('App\Models\Project', 'project_id');
  16. }
  17. public function inner_device()
  18. {
  19. return $this->belongsTo('App\Models\InnerDevice', 'inner_device_id');
  20. }
  21. public function work_point()
  22. {
  23. return $this->belongsTo('App\Models\WorkPoint', 'work_point_id');
  24. }
  25. }