Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIMS-1003: Fix searching of container inspections #825

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions api/src/Page/Imaging.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,11 @@ function _get_inspections()
$where .= " AND i.state='Completed'";
}

if ($this->has_arg('s')) {
$where .= " AND (CONCAT(p.proposalcode, p.proposalnumber) LIKE CONCAT('%', :" . (sizeof($args) + 1) . ", '%') OR c.code LIKE CONCAT('%', :" . (sizeof($args) + 2) . ", '%'))";
array_push($args, $this->arg('s'), $this->arg('s'));
}

$tot = $this->db->pq("SELECT count(i.containerinspectionid) as tot FROM containerinspection i
INNER JOIN container c ON c.containerid = i.containerid
INNER JOIN dewar d ON d.dewarid = c.dewarid
Expand Down Expand Up @@ -422,12 +427,6 @@ function _get_inspections()
$order = $cols[$this->arg('sort_by')] . ' ' . $dir;
}

if ($this->has_arg('s')) {
$where .= " AND (LOWER(CONCAT(p.proposalcode, p.proposalnumber)) LIKE LOWER(CONCAT(CONCAT('%', :" . (sizeof($args) + 1) . "), '%')) OR LOWER(c.code) LIKE LOWER(CONCAT(CONCAT('%', :" . (sizeof($args) + 2) . "), '%')))";
array_push($args, $this->arg('s'));
array_push($args, $this->arg('s'));
}

if ($this->has_arg('ty')) {
if ($this->arg('ty') == 'COMPLETED')
$where .= " AND i.state = 'Completed' AND i.manual=0";
Expand Down
Loading