dataRange() ->catchSearch() ->append(['state_text']) ->order($this->aliasField('id'), 'desc') ->paginate(); return $res; } public function searchPlateNoAttr($query, $value, $data) { return $query->where('plate_no', 'like', '%' . $value . '%'); } public function searchRfidSnAttr($query, $value, $data) { return $query->where('rfid_sn', 'like', '%' . $value . '%'); } public function searchAlarmTypeAttr($query, $value, $data) { return $query->where('alarm_type', $value); } public function getStateTextAttr($value){ $state = $this->getData('state'); return (new SysDictData())->getValueByCode('AlarmHandleState', $state) ?: ''; } public function getAlarmTypeAttr($value){ return (new SysDictData())->getValueByCode('AlarmType', $value) ?: ''; } }