WorkerBikeOperate.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. class WorkerBikeOperate extends Model
  5. {
  6. //
  7. protected $table = "worker_bike_operates";
  8. protected $guarded = [];
  9. const TYPE_ONLINE = 1;
  10. const TYPE_OFFLINE = 0;
  11. const TYPE_OPEN_BIKE_LOCK = 2;
  12. const TYPE_CLOSE_BIKE_LOCK = 3;
  13. const TYPE_OPEN_BATTERY_LOCK = 4;
  14. const TYPE_CLOSE_BATTERY_LOCK = 5;
  15. const TYPE_REBOOT_BOX = 6;
  16. const TYPE_NOW_BIKE_LOCATION = 7;
  17. const TYPE_NOW_BIKE_BATTERY_MSG = 8;
  18. public static $typeMaps = [
  19. self::TYPE_OFFLINE => '操作下线',
  20. self::TYPE_ONLINE => '操作上线',
  21. self::TYPE_OPEN_BIKE_LOCK => '操作开电车锁',
  22. self::TYPE_CLOSE_BIKE_LOCK => '操作关闭电车锁',
  23. self::TYPE_OPEN_BATTERY_LOCK => '操作开电池锁',
  24. self::TYPE_CLOSE_BATTERY_LOCK => '操作关电池锁',
  25. self::TYPE_REBOOT_BOX => '重启中控',
  26. self::TYPE_NOW_BIKE_LOCATION => '立即定位',
  27. self::TYPE_NOW_BIKE_BATTERY_MSG => '立即刷新电池信息'
  28. ];
  29. public function workers(){
  30. return $this->belongsTo(AdminUser::class,'worker_id','id');
  31. }
  32. }