BikeTrouble.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. namespace App\Models;
  3. use App\Traits\ModelHelpers;
  4. use Illuminate\Database\Eloquent\Model;
  5. /*弃用*/
  6. class BikeTrouble extends Model
  7. {
  8. // use ModelHelpers;
  9. // //
  10. // protected $table = "bike_troubles";
  11. //
  12. // const TROUBLE_PART_TEST1 = 1;
  13. // const TROUBLE_PART_TEST2 = 2;
  14. // const TROUBLE_PART_TEST3 = 3;
  15. // const TROUBLE_PART_TEST4 = 4;
  16. // const TROUBLE_PART_TEST5 = 5;
  17. // const TROUBLE_PART_TEST6 = 6;
  18. // const TROUBLE_PART_TEST7 = 7;
  19. // public static $troublePartMaps = [
  20. // self::TROUBLE_PART_TEST1 => '电池电量不足',
  21. // self::TROUBLE_PART_TEST2 => '控制器(硬件)故障',
  22. // self::TROUBLE_PART_TEST3 => '控制器通信故障',
  23. // self::TROUBLE_PART_TEST4 => '控制器掉电故障',
  24. // self::TROUBLE_PART_TEST5 => '转把故障',
  25. // self::TROUBLE_PART_TEST6 => '电机故障',
  26. // self::TROUBLE_PART_TEST7 => '刹车故障',
  27. // ];
  28. // const TROUBLE_GRADE_ONE = 1;
  29. // const TROUBLE_GRADE_TWO = 2;
  30. // const TROUBLE_GRADE_THREE = 3;
  31. // const TROUBLE_GRADE_FOUR = 4;
  32. // const TROUBLE_GRADE_FIVE = 5;
  33. // public static $troubleGradeMaps = [
  34. // self::TROUBLE_GRADE_ONE => '紧急故障',
  35. // self::TROUBLE_GRADE_TWO => '高级故障',
  36. // self::TROUBLE_GRADE_THREE => '中级故障',
  37. // self::TROUBLE_GRADE_FOUR => '一般故障',
  38. // self::TROUBLE_GRADE_FIVE => '简单故障',
  39. // ];
  40. //
  41. // public static function getTroubleGrade($trouble_part){
  42. // switch ($trouble_part){
  43. // case self::TROUBLE_PART_TEST1:
  44. // return self::TROUBLE_GRADE_FOUR;
  45. // break;
  46. // case self::TROUBLE_PART_TEST2 || self::TROUBLE_PART_TEST3:
  47. // return self::TROUBLE_GRADE_ONE;
  48. // break;
  49. // case self::TROUBLE_PART_TEST4 || self::TROUBLE_PART_TEST6:
  50. // return self::TROUBLE_GRADE_TWO;
  51. // break;
  52. // case self::TROUBLE_PART_TEST5 || self::TROUBLE_PART_TEST7:
  53. // return self::TROUBLE_GRADE_THREE;
  54. // break;
  55. // default:
  56. // return self::TROUBLE_GRADE_FIVE;
  57. // }
  58. // }
  59. //
  60. // const FIX_STATUS_NO = 0;
  61. // const FIX_STATUS_OK = 1;
  62. // public static $fixStatusMaps = [
  63. // self::FIX_STATUS_NO => '未维修',
  64. // self::FIX_STATUS_OK => '已维修',
  65. // ];
  66. //
  67. // public function worker(){
  68. // // 实际维修人员
  69. // return $this->belongsTo(AdminUser::class,'fix_worker_id','id');
  70. // }
  71. //
  72. // public function bike(){
  73. // return $this->belongsTo(Bike::class,'bike_id','id');
  74. // }
  75. //
  76. // public function user(){
  77. // return $this->belongsTo(User::class,'user_id','id');
  78. // }
  79. //
  80. // public function area(){
  81. // return $this->belongsTo(Area::class,'area_id','id');
  82. // }
  83. //
  84. // public function area_worker(){
  85. //
  86. // // 故障区域 所有维修人员
  87. // return $this->hasMany(AdminUser::class,'area_id','area_id');
  88. // }
  89. }