Lines 1337-1342
sub _SearchItems_build_where_fragment {
Link Here
|
1337 |
if ( (0 < grep { $_ eq $field } @columns) or (substr($field, 0, 5) eq 'marc:') ) { |
1337 |
if ( (0 < grep { $_ eq $field } @columns) or (substr($field, 0, 5) eq 'marc:') ) { |
1338 |
my $op = $filter->{operator}; |
1338 |
my $op = $filter->{operator}; |
1339 |
my $query = $filter->{query}; |
1339 |
my $query = $filter->{query}; |
|
|
1340 |
my $ifnull = $filter->{ifnull}; |
1340 |
|
1341 |
|
1341 |
if (!$op or (0 == grep { $_ eq $op } @operators)) { |
1342 |
if (!$op or (0 == grep { $_ eq $op } @operators)) { |
1342 |
$op = '='; # default operator |
1343 |
$op = '='; # default operator |
Lines 1377-1382
sub _SearchItems_build_where_fragment {
Link Here
|
1377 |
$column = $field; |
1378 |
$column = $field; |
1378 |
} |
1379 |
} |
1379 |
|
1380 |
|
|
|
1381 |
if ( defined $ifnull ) { |
1382 |
$column = "IFNULL($column, ?)"; |
1383 |
} |
1384 |
|
1380 |
if (ref $query eq 'ARRAY') { |
1385 |
if (ref $query eq 'ARRAY') { |
1381 |
if ($op eq '=') { |
1386 |
if ($op eq '=') { |
1382 |
$op = 'IN'; |
1387 |
$op = 'IN'; |
Lines 1393-1398
sub _SearchItems_build_where_fragment {
Link Here
|
1393 |
args => [ $query ], |
1398 |
args => [ $query ], |
1394 |
}; |
1399 |
}; |
1395 |
} |
1400 |
} |
|
|
1401 |
|
1402 |
if ( defined $ifnull ) { |
1403 |
unshift @{ $where_fragment->{args} }, $ifnull; |
1404 |
} |
1396 |
} |
1405 |
} |
1397 |
} |
1406 |
} |
1398 |
|
1407 |
|