sub
_select {
my
(
$self
,
$ident
,
$select
,
$condition
,
$attrs
) =
@_
;
if
(
ref
$select
eq
'ARRAY'
) {
@{
$select
} =
map
{
$self
->replace_distincts(
$_
)} @{
$select
};
}
else
{
$select
=
$self
->replace_distincts(
$select
);
}
return
$self
->
next
::method(
$ident
,
$select
,
$condition
,
$attrs
);
}
sub
replace_distincts {
my
(
$self
,
$select
) =
@_
;
$select
->{count}->{distinct} =
join
(
"||"
, @{
$select
->{count}->{distinct}})
if
(
ref
$select
eq
'HASH'
&&
$select
->{count} &&
ref
$select
->{count} eq
'HASH'
&&
$select
->{count}->{distinct} &&
ref
$select
->{count}->{distinct} eq
'ARRAY'
);
return
$select
;
}
1;