| @@ 562-569 (lines=8) @@ | ||
| 559 | $ret = array(); |
|
| 560 | $limit = $start = 0; |
|
| 561 | $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_answers'); |
|
| 562 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
|
| 563 | $sql .= ' ' . $criteria->renderWhere(); |
|
| 564 | if ($criteria->getSort() != '') { |
|
| 565 | $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 566 | } |
|
| 567 | $limit = $criteria->getLimit(); |
|
| 568 | $start = $criteria->getStart(); |
|
| 569 | } |
|
| 570 | //echo "<br>" . $sql . "<br>"; |
|
| 571 | $result = $this->db->query($sql, $limit, $start); |
|
| 572 | if (!$result) { |
|
| @@ 417-424 (lines=8) @@ | ||
| 414 | $ret = array(); |
|
| 415 | $limit = $start = 0; |
|
| 416 | $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_categories'); |
|
| 417 | if (null !== $criteria && is_subclass_of($criteria, 'criteriaelement')) { |
|
| 418 | $sql .= ' ' . $criteria->renderWhere(); |
|
| 419 | if ($criteria->getSort() != '') { |
|
| 420 | $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 421 | } |
|
| 422 | $limit = $criteria->getLimit(); |
|
| 423 | $start = $criteria->getStart(); |
|
| 424 | } |
|
| 425 | //echo "<br>" . $sql . "<br>"; |
|
| 426 | $result = $this->db->query($sql, $limit, $start); |
|
| 427 | if (!$result) { |
|
| @@ 524-531 (lines=8) @@ | ||
| 521 | $ret = array(); |
|
| 522 | $limit = $start = 0; |
|
| 523 | $sql = 'SELECT DISTINCT c.categoryid, c.parentid, c.name, c.description, c.total, c.weight, c.created FROM ' . $this->db->prefix('smartfaq_categories') . ' AS c INNER JOIN ' . $this->db->prefix('smartfaq_faq') . ' AS f ON c.categoryid = f.categoryid'; |
|
| 524 | if (null !== ($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
|
| 525 | $sql .= ' ' . $criteria->renderWhere(); |
|
| 526 | if ($criteria->getSort() != '') { |
|
| 527 | $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 528 | } |
|
| 529 | $limit = $criteria->getLimit(); |
|
| 530 | $start = $criteria->getStart(); |
|
| 531 | } |
|
| 532 | //echo "<br>" . $sql . "<br>"; |
|
| 533 | $result = $this->db->query($sql, $limit, $start); |
|
| 534 | if (!$result) { |
|
| @@ 1613-1620 (lines=8) @@ | ||
| 1610 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
|
| 1611 | $whereClause = $criteria->renderWhere(); |
|
| 1612 | ||
| 1613 | if ($whereClause !== 'WHERE ()') { |
|
| 1614 | $sql .= ' ' . $criteria->renderWhere(); |
|
| 1615 | if ($criteria->getSort() != '') { |
|
| 1616 | $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 1617 | } |
|
| 1618 | $limit = $criteria->getLimit(); |
|
| 1619 | $start = $criteria->getStart(); |
|
| 1620 | } |
|
| 1621 | } |
|
| 1622 | ||
| 1623 | //echo "<br>" . $sql . "<br>"; |
|