123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- <?php
- namespace App\Models;
- use App\Traits\ModelHelpers;
- use Illuminate\Database\Eloquent\Model;
- class WarningLog extends Model
- {
- use ModelHelpers;
- //
- protected $table = 'warning_logs';
- //备用
- const TYPE_DEFAULT = 0;
- // 电池电量低
- const TYPE_BATTERY_LOW = 11;
- //异常订单
- const TYPE_ABNORMAL_ORDER = 12;
- // 电车骑出骑行区域
- const TYPE_BIKE_OUT_AREA = 21;
- // 电车骑出骑行区域的辐射范围
- const TYPE_BIKE_OUT_AREA_ = 22;
- //车辆定位出现问题
- const TYPE_BIKE_LOCATION_ERROR = 51;
- //备用电池低电告警
- const TYPE_WARNING_BATTERY_LOW = 31;
- //震动报警
- const TYPE_WARNING_BIKE_SHOCK = 32;
- //非法打开电门报警
- const TYPE_WARNING_BIKE_OPEN = 33;
- //电子围栏报警
- const TYPE_WARNING_FENCE = 34;
- // BMS异常报警
- const TYPE_WARNING_BMS = 35;
- // 断电报警、GPS自检测
- const TYPE_WARNING_CLOSE_ELECTRIC = 36;
- // 超速告警
- const TYPE_WARNING_OVER_SPEED = 37;
- //轮动告警
- const TYPE_WARNING_WHEEL_MOVE = 38;
- //车辆故障
- const TYPE_WARNING_BIKE_TROUBLE = 39;
- //登录日志
- const TYPE_REBOOT_LOG = 40;
- // 车辆离线
- const TYPE_BIKE_OFF_LINE = 41;
- public static $typeMaps = [
- // self::TYPE_DEFAULT => '备用',
- self::TYPE_BATTERY_LOW => '电池电量低',
- self::TYPE_BIKE_OUT_AREA => '电车骑出骑行区域',
- self::TYPE_BIKE_OUT_AREA_ => '电车骑出骑行区域的辐射范围',
- self::TYPE_WARNING_BATTERY_LOW => '备用电池低电告警',
- self::TYPE_WARNING_BIKE_SHOCK => '震动报警',
- self::TYPE_WARNING_BIKE_OPEN => '非法打开电门报警',
- self::TYPE_WARNING_FENCE => '电子围栏报警',
- self::TYPE_WARNING_BMS => 'BMS异常报警',
- self::TYPE_WARNING_CLOSE_ELECTRIC => '断电报警、GPS自检测',
- self::TYPE_WARNING_OVER_SPEED => '超速告警',
- self::TYPE_WARNING_WHEEL_MOVE => '轮动告警',
- self::TYPE_WARNING_BIKE_TROUBLE => '车辆故障',
- self::TYPE_BIKE_OFF_LINE => '车辆离线',
- self::TYPE_ABNORMAL_ORDER => '无订单异常骑行',
- self::TYPE_BIKE_LOCATION_ERROR => '车辆定位出现问题(车可能进入室内或定位器坏了)',
- self::TYPE_REBOOT_LOG => '登录中控',
- ];
- /**
- * 错误等级
- */
- // 默认
- const ERROR_GRADE_DEFAULT = 0;
- // 次要
- const ERROR_GRADE_MINOR = 1;
- // 一般
- const ERROR_GRADE_MAJOR = 2;
- // 重要
- const ERROR_GRADE_CRITICAL = 3;
- //立马解决/**/
- const ERROR_GRADE_NOW = 4;
- public static $reasonMaps = [
- 0 => '未知原因重启',
- 1 => 'GPS连续10分钟输出错误,重启系统',
- 2 => 'GPRS连续超过30分钟未登陆成功重启设备',
- 3 => 'GPRS链路心跳包超时未收到重启设备',
- 4 => '心跳包超过时间没有收到发生的系统重启修复动作',
- 5 => '当用户被修改时导致的重登陆',
- 6 => '当终端SIM被修改时导致的重登陆',
- 7 => '当终端收到激活短信时导致的重登陆',
- 8 => '当终端收到短信的重登陆指令时',
- 9 => '用户下发的主动复位指令,让系统主动复位',
- 10 => '用户下发的主动关机指令,让系统主动关机',
- 11 => '当用户下发的免激活之后重登陆指令',
- 12 => '当APN被修改时导致的用户重登陆操作',
- 13 => '当域名被修改时导致的重登陆',
- 14 => '当上网模式被修改时导致的重登陆',
- 15 => '当UDP,TCP模式切换时导致的重登陆',
- 16 => '当终端的TID被修改时导致的重登陆',
- 17 => '当GSENCOR超过一定的次数还没有修复成功的时候,就进行重启修复一次',
- 18 => '当SIM卡插入时自动重启设备一次',
- 19 => '当设备中的超级猫号码更改时导致的重登陆',
- 20 => '当设备的PDP激活次数超过系统规定的时间时,重启一次系统',
- 21 => '设备从FLASH中加载重启原因发生错误',
- 22 => '设备远程升级之后的自动重启功能',
- 23 => '用户下发的格式化指令',
- 24 => '系统自修复重启机制',
- 25 => '系统自修复重启机制',
- 30 => '主域名与备用IP间的5分钟切换导致的重登陆',
- 37 => 'GPS长时间没有吐出PUBX语句导致的重启',
- ];
- }
|