fixed a limitation with buildSearchQuery in SQL
started working on registrant search in EMS
This commit is contained in:
parent
4ca80ad734
commit
ac3c7d18b9
6 changed files with 123 additions and 18 deletions
|
|
@ -428,7 +428,7 @@ sub www_getTaxesAsJson {
|
|||
my $sql = 'select SQL_CALC_FOUND_ROWS * from tax';
|
||||
my $keywords = $form->get("keywords");
|
||||
if ($keywords ne "") {
|
||||
($sql, @placeholders) = $db->buildSearchQuery($sql, $keywords, [qw{country state city code}])
|
||||
$db->buildSearchQuery(\$sql, \@placeholders, $keywords, [qw{country state city code}])
|
||||
}
|
||||
push(@placeholders, $sortKey, $sortDir, $startIndex, $numberOfResults);
|
||||
$sql .= ' order by ? ? limit ?,?';
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ sub www_getTransactionsAsJson {
|
|||
from transaction';
|
||||
my $keywords = $form->get("keywords");
|
||||
if ($keywords ne "") {
|
||||
($sql, @placeholders) = $db->buildSearchQuery($sql, $keywords, [qw{amount username orderNumber shippingAddressName shippingAddress1 paymentAddressName paymentAddress1}])
|
||||
$db->buildSearchQuery(\$sql, \@placeholders, $keywords, [qw{amount username orderNumber shippingAddressName shippingAddress1 paymentAddressName paymentAddress1}])
|
||||
}
|
||||
push(@placeholders, $startIndex, $numberOfResults);
|
||||
$sql .= ' order by dateOfPurchase desc limit ?,?';
|
||||
|
|
@ -434,7 +434,6 @@ sub www_getTransactionsAsJson {
|
|||
push(@records,$record);
|
||||
}
|
||||
$results{'recordsReturned'} = $sth->rows()+0;
|
||||
$sth->finish;
|
||||
$results{'totalRecords'} = $db->quickScalar('select found_rows()') + 0; ##Convert to numeric
|
||||
$results{'records'} = \@records;
|
||||
$results{'startIndex'} = $startIndex;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue