1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- namespace App\Models;
- use App\Traits\ModelHelpers;
- use Illuminate\Database\Eloquent\Model;
- /*弃用*/
- class BikeTrouble extends Model
- {
- // use ModelHelpers;
- // //
- // protected $table = "bike_troubles";
- //
- // const TROUBLE_PART_TEST1 = 1;
- // const TROUBLE_PART_TEST2 = 2;
- // const TROUBLE_PART_TEST3 = 3;
- // const TROUBLE_PART_TEST4 = 4;
- // const TROUBLE_PART_TEST5 = 5;
- // const TROUBLE_PART_TEST6 = 6;
- // const TROUBLE_PART_TEST7 = 7;
- // public static $troublePartMaps = [
- // self::TROUBLE_PART_TEST1 => '电池电量不足',
- // self::TROUBLE_PART_TEST2 => '控制器(硬件)故障',
- // self::TROUBLE_PART_TEST3 => '控制器通信故障',
- // self::TROUBLE_PART_TEST4 => '控制器掉电故障',
- // self::TROUBLE_PART_TEST5 => '转把故障',
- // self::TROUBLE_PART_TEST6 => '电机故障',
- // self::TROUBLE_PART_TEST7 => '刹车故障',
- // ];
- // const TROUBLE_GRADE_ONE = 1;
- // const TROUBLE_GRADE_TWO = 2;
- // const TROUBLE_GRADE_THREE = 3;
- // const TROUBLE_GRADE_FOUR = 4;
- // const TROUBLE_GRADE_FIVE = 5;
- // public static $troubleGradeMaps = [
- // self::TROUBLE_GRADE_ONE => '紧急故障',
- // self::TROUBLE_GRADE_TWO => '高级故障',
- // self::TROUBLE_GRADE_THREE => '中级故障',
- // self::TROUBLE_GRADE_FOUR => '一般故障',
- // self::TROUBLE_GRADE_FIVE => '简单故障',
- // ];
- //
- // public static function getTroubleGrade($trouble_part){
- // switch ($trouble_part){
- // case self::TROUBLE_PART_TEST1:
- // return self::TROUBLE_GRADE_FOUR;
- // break;
- // case self::TROUBLE_PART_TEST2 || self::TROUBLE_PART_TEST3:
- // return self::TROUBLE_GRADE_ONE;
- // break;
- // case self::TROUBLE_PART_TEST4 || self::TROUBLE_PART_TEST6:
- // return self::TROUBLE_GRADE_TWO;
- // break;
- // case self::TROUBLE_PART_TEST5 || self::TROUBLE_PART_TEST7:
- // return self::TROUBLE_GRADE_THREE;
- // break;
- // default:
- // return self::TROUBLE_GRADE_FIVE;
- // }
- // }
- //
- // const FIX_STATUS_NO = 0;
- // const FIX_STATUS_OK = 1;
- // public static $fixStatusMaps = [
- // self::FIX_STATUS_NO => '未维修',
- // self::FIX_STATUS_OK => '已维修',
- // ];
- //
- // public function worker(){
- // // 实际维修人员
- // return $this->belongsTo(AdminUser::class,'fix_worker_id','id');
- // }
- //
- // public function bike(){
- // return $this->belongsTo(Bike::class,'bike_id','id');
- // }
- //
- // public function user(){
- // return $this->belongsTo(User::class,'user_id','id');
- // }
- //
- // public function area(){
- // return $this->belongsTo(Area::class,'area_id','id');
- // }
- //
- // public function area_worker(){
- //
- // // 故障区域 所有维修人员
- // return $this->hasMany(AdminUser::class,'area_id','area_id');
- // }
- }
|