OrderDevice.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App\Models;
  3. class OrderDevice extends BaseModel
  4. {
  5. public function device()
  6. {
  7. return $this->belongsTo('App\Models\Device', 'device_id');
  8. }
  9. public function inner_device()
  10. {
  11. return $this->belongsTo('App\Models\InnerDevice', 'inner_device_id');
  12. }
  13. public function device_name()
  14. {
  15. return $this->belongsTo('App\Models\DeviceName', 'device_name_id');
  16. // return $this->hasOne(InnerDeviceNamesModel::class,'id','device_name_id');
  17. }
  18. public function spec()
  19. {
  20. return $this->belongsTo('App\Models\Spec', 'spec_id');
  21. }
  22. public function rent_type()
  23. {
  24. return $this->belongsTo('App\Models\RentType', 'rent_type_id');
  25. }
  26. public function project()
  27. {
  28. return $this->belongsTo('App\Models\Project', 'project_id');
  29. }
  30. public function user()
  31. {
  32. return $this->belongsTo('App\Models\User', 'user_id');
  33. }
  34. public function order()
  35. {
  36. return $this->belongsTo('App\Models\Order', 'order_id');
  37. }
  38. }