distinct on device search - github issue #12

This commit is contained in:
Oliver Gorwits
2012-02-20 20:35:54 +00:00
parent db77376422
commit 5d39a972b7

View File

@@ -161,7 +161,10 @@ sub search_by_field {
}, },
{ {
order_by => [qw/ me.dns me.ip /], order_by => [qw/ me.dns me.ip /],
(($p->{dns} or $p->{ip}) ? (join => 'device_ips') : ()), (($p->{dns} or $p->{ip}) ? (
join => 'device_ips',
distinct => 1,
) : ()),
} }
); );
} }
@@ -233,6 +236,7 @@ sub search_fuzzy {
{ {
order_by => [qw/ me.dns me.ip /], order_by => [qw/ me.dns me.ip /],
join => 'device_ips', join => 'device_ips',
distinct => 1,
} }
); );
} }