Lines 1333-1338
sub _SearchItems_build_where_fragment {
Link Here
|
1333 |
if ( (0 < grep { $_ eq $field } @columns) or (substr($field, 0, 5) eq 'marc:') ) { |
1333 |
if ( (0 < grep { $_ eq $field } @columns) or (substr($field, 0, 5) eq 'marc:') ) { |
1334 |
my $op = $filter->{operator}; |
1334 |
my $op = $filter->{operator}; |
1335 |
my $query = $filter->{query}; |
1335 |
my $query = $filter->{query}; |
|
|
1336 |
my $ifnull = $filter->{ifnull}; |
1336 |
|
1337 |
|
1337 |
if (!$op or (0 == grep { $_ eq $op } @operators)) { |
1338 |
if (!$op or (0 == grep { $_ eq $op } @operators)) { |
1338 |
$op = '='; # default operator |
1339 |
$op = '='; # default operator |
Lines 1373-1378
sub _SearchItems_build_where_fragment {
Link Here
|
1373 |
$column = $field; |
1374 |
$column = $field; |
1374 |
} |
1375 |
} |
1375 |
|
1376 |
|
|
|
1377 |
if ( defined $ifnull ) { |
1378 |
$column = "IFNULL($column, ?)"; |
1379 |
} |
1380 |
|
1376 |
if (ref $query eq 'ARRAY') { |
1381 |
if (ref $query eq 'ARRAY') { |
1377 |
if ($op eq '=') { |
1382 |
if ($op eq '=') { |
1378 |
$op = 'IN'; |
1383 |
$op = 'IN'; |
Lines 1389-1394
sub _SearchItems_build_where_fragment {
Link Here
|
1389 |
args => [ $query ], |
1394 |
args => [ $query ], |
1390 |
}; |
1395 |
}; |
1391 |
} |
1396 |
} |
|
|
1397 |
|
1398 |
if ( defined $ifnull ) { |
1399 |
unshift @{ $where_fragment->{args} }, $ifnull; |
1400 |
} |
1392 |
} |
1401 |
} |
1393 |
} |
1402 |
} |
1394 |
|
1403 |
|