Bug 25683: (follow-up) Use COALESCE instead of IFNULL
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
c7ae33f60c
commit
e1509855d3
|
|
@ -399,8 +399,8 @@ sub search_patrons_to_update_category {
|
|||
$query{join} = ["accountlines"];
|
||||
$query{columns} = ["borrowernumber"];
|
||||
$query{group_by} = ["borrowernumber"];
|
||||
$query{having} = \['IFNULL(sum(accountlines.amountoutstanding),0) <= ?',$params->{fine_max}] if defined $params->{fine_max};
|
||||
$query{having} = \['IFNULL(sum(accountlines.amountoutstanding),0) >= ?',$params->{fine_min}] if defined $params->{fine_min};
|
||||
$query{having} = \['COALESCE(sum(accountlines.amountoutstanding),0) <= ?',$params->{fine_max}] if defined $params->{fine_max};
|
||||
$query{having} = \['COALESCE(sum(accountlines.amountoutstanding),0) >= ?',$params->{fine_min}] if defined $params->{fine_min};
|
||||
}
|
||||
return $self->search($search_params,\%query);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue