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> (cherry picked from commite1509855d3) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> (cherry picked from commit6bea771b80) Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
This commit is contained in:
parent
eedc695432
commit
60adc95f52
|
|
@ -395,8 +395,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