public function _getWhere(Am_Query $q) { $a = $q->getAlias(); $f = '%' . $this->filter . '%'; return $q->escapeWithPlaceholders("({$a}.login LIKE ?) OR ({$a}.email LIKE ?) OR ({$a}.name_f LIKE ?) OR ({$a}.name_l LIKE ?)\n OR CONCAT({$a}.name_f, ' ', {$a}.name_l) LIKE ?\n OR ({$a}.remote_addr LIKE ?)\n OR ({$a}.user_id IN (SELECT user_id FROM ?_invoice WHERE public_id=? OR CAST(invoice_id as char(11))=?))\n OR ({$a}.user_id IN (SELECT user_id FROM ?_invoice_payment WHERE receipt_id=?))\n ", $f, $f, $f, $f, $f, $f, $this->filter, $this->filter, $this->filter); }
public function _getWhere(Am_Query $q) { $a = $q->getAlias(); $f = '%' . $this->filter . '%'; return $q->escapeWithPlaceholders("({$a}.login LIKE ?) OR ({$a}.email LIKE ?) OR ({$a}.name_f LIKE ?) OR ({$a}.name_l LIKE ?) \n OR ({$a}.user_id = (SELECT user_id FROM ?_invoice WHERE public_id=? OR invoice_id=? LIMIT 1))\n OR ({$a}.user_id = (SELECT user_id FROM ?_invoice_payment WHERE receipt_id=? LIMIT 1))\n ", $f, $f, $f, $f, $this->filter, $this->filter, $this->filter); }