complete the migration of connected device ID to connected inventory
This commit is contained in:
@@ -113,6 +113,10 @@ will add the following additional synthesized columns to the result set:
|
||||
|
||||
=item error_disable_cause
|
||||
|
||||
=item remote_is_wap (boolean)
|
||||
|
||||
=item remote_is_phone (boolean)
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
@@ -124,8 +128,54 @@ sub with_properties {
|
||||
->search_rs($cond, $attrs)
|
||||
->search({},
|
||||
{
|
||||
'+select' => ['properties.error_disable_cause'],
|
||||
'+as' => ['properties_error_disable_cause'],
|
||||
'+select' => [qw/
|
||||
properties.error_disable_cause
|
||||
properties.remote_is_wap
|
||||
properties.remote_is_phone
|
||||
/],
|
||||
'+as' => [qw/
|
||||
error_disable_cause
|
||||
remote_is_wap remote_is_phone
|
||||
/],
|
||||
join => 'properties',
|
||||
});
|
||||
}
|
||||
|
||||
=head2 with_remote_inventory
|
||||
|
||||
This is a modifier for any C<search()> which
|
||||
will add the following additional synthesized columns to the result set:
|
||||
|
||||
=over 4
|
||||
|
||||
=item remote_vendor
|
||||
|
||||
=item remote_model
|
||||
|
||||
=item remote_os_ver
|
||||
|
||||
=item remote_serial
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
sub with_remote_inventory {
|
||||
my ($rs, $cond, $attrs) = @_;
|
||||
|
||||
return $rs
|
||||
->search_rs($cond, $attrs)
|
||||
->search({},
|
||||
{
|
||||
'+select' => [qw/
|
||||
properties.remote_vendor
|
||||
properties.remote_model
|
||||
properties.remote_os_ver
|
||||
properties.remote_serial
|
||||
/],
|
||||
'+as' => [qw/
|
||||
remote_vendor remote_model remote_os_ver remote_serial
|
||||
/],
|
||||
join => 'properties',
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user