12345678910111213141516171819202122232425262728293031323334 |
- <?php
- namespace App\Model;
- use Illuminate\Database\Eloquent\Model;
- class DeviceType extends Model
- {
- protected $table = "device_type"; //指定表
- const CREATED_AT = 'crt_time';
- const UPDATED_AT = 'upd_time';
- protected $dateFormat = 'U';
- const type_one = 1;
- const type_two = 2;
- const type_three = 3;
- const type_four = 4;
- const temperature_normal = '温度正常';
- const temperature_abnormal = '温度异常';
- const humidity_normal = '湿度正常';
- const humidity_abnormal = '湿度异常';
- public static $abnormal = [self::temperature_abnormal,self::humidity_abnormal];
- public static $normal = [self::temperature_normal,self::humidity_normal];
- //节点一
- public static $node_one = [2]; //开关类
- //节点二
- public static $node_two = [1]; //传感器类
- //节点三
- public static $node_three = [3]; // 预警类
- }
|