| @@ 566-573 (lines=8) @@ | ||
| 563 | $ret = array(); |
|
| 564 | $limit = $start = 0; |
|
| 565 | $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_answers'); |
|
| 566 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
|
| 567 | $sql .= ' ' . $criteria->renderWhere(); |
|
| 568 | if ($criteria->getSort() != '') { |
|
| 569 | $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 570 | } |
|
| 571 | $limit = $criteria->getLimit(); |
|
| 572 | $start = $criteria->getStart(); |
|
| 573 | } |
|
| 574 | //echo "<br>" . $sql . "<br>"; |
|
| 575 | $result = $this->db->query($sql, $limit, $start); |
|
| 576 | if (!$result) { |
|
| @@ 416-423 (lines=8) @@ | ||
| 413 | $ret = array(); |
|
| 414 | $limit = $start = 0; |
|
| 415 | $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_categories'); |
|
| 416 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
|
| 417 | $sql .= ' ' . $criteria->renderWhere(); |
|
| 418 | if ($criteria->getSort() != '') { |
|
| 419 | $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 420 | } |
|
| 421 | $limit = $criteria->getLimit(); |
|
| 422 | $start = $criteria->getStart(); |
|
| 423 | } |
|
| 424 | //echo "<br>" . $sql . "<br>"; |
|
| 425 | $result = $this->db->query($sql, $limit, $start); |
|
| 426 | if (!$result) { |
|
| @@ 527-534 (lines=8) @@ | ||
| 524 | . ' AS c INNER JOIN ' |
|
| 525 | . $this->db->prefix('smartfaq_faq') |
|
| 526 | . ' AS f ON c.categoryid = f.categoryid'; |
|
| 527 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
|
| 528 | $sql .= ' ' . $criteria->renderWhere(); |
|
| 529 | if ($criteria->getSort() != '') { |
|
| 530 | $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 531 | } |
|
| 532 | $limit = $criteria->getLimit(); |
|
| 533 | $start = $criteria->getStart(); |
|
| 534 | } |
|
| 535 | //echo "<br>" . $sql . "<br>"; |
|
| 536 | $result = $this->db->query($sql, $limit, $start); |
|
| 537 | if (!$result) { |
|
| @@ 1629-1636 (lines=8) @@ | ||
| 1626 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
|
| 1627 | $whereClause = $criteria->renderWhere(); |
|
| 1628 | ||
| 1629 | if ($whereClause !== 'WHERE ()') { |
|
| 1630 | $sql .= ' ' . $criteria->renderWhere(); |
|
| 1631 | if ($criteria->getSort() != '') { |
|
| 1632 | $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 1633 | } |
|
| 1634 | $limit = $criteria->getLimit(); |
|
| 1635 | $start = $criteria->getStart(); |
|
| 1636 | } |
|
| 1637 | } |
|
| 1638 | ||
| 1639 | //echo "<br>" . $sql . "<br>"; |
|