catchSearch() ->order($this->aliasField('id'), 'desc') ->paginate(); } public function searchDeviceNumberAttr($query, $value, $data) { return $query->where('device_number',$value); } public function getOnlineTimeAttr($value) { return $value ? date('Y-m-d H:i:s',$value) : ''; } }