| @@ 522-529 (lines=8) @@ | ||
| 519 | $ret = array(); |
|
| 520 | $limit = $start = 0; |
|
| 521 | $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_answers'); |
|
| 522 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
|
| 523 | $sql .= ' ' . $criteria->renderWhere(); |
|
| 524 | if ($criteria->getSort() != '') { |
|
| 525 | $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 526 | } |
|
| 527 | $limit = $criteria->getLimit(); |
|
| 528 | $start = $criteria->getStart(); |
|
| 529 | } |
|
| 530 | //echo "<br />" . $sql . "<br />"; |
|
| 531 | $result = $this->db->query($sql, $limit, $start); |
|
| 532 | if (!$result) { |
|
| @@ 414-421 (lines=8) @@ | ||
| 411 | $ret = array(); |
|
| 412 | $limit = $start = 0; |
|
| 413 | $sql = 'SELECT * FROM ' . $this->db->prefix('smartfaq_categories'); |
|
| 414 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
|
| 415 | $sql .= ' ' . $criteria->renderWhere(); |
|
| 416 | if ($criteria->getSort() != '') { |
|
| 417 | $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 418 | } |
|
| 419 | $limit = $criteria->getLimit(); |
|
| 420 | $start = $criteria->getStart(); |
|
| 421 | } |
|
| 422 | //echo "<br />" . $sql . "<br />"; |
|
| 423 | $result = $this->db->query($sql, $limit, $start); |
|
| 424 | if (!$result) { |
|
| @@ 510-517 (lines=8) @@ | ||
| 507 | $ret = array(); |
|
| 508 | $limit = $start = 0; |
|
| 509 | $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'; |
|
| 510 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
|
| 511 | $sql .= ' ' . $criteria->renderWhere(); |
|
| 512 | if ($criteria->getSort() != '') { |
|
| 513 | $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 514 | } |
|
| 515 | $limit = $criteria->getLimit(); |
|
| 516 | $start = $criteria->getStart(); |
|
| 517 | } |
|
| 518 | //echo "<br />" . $sql . "<br />"; |
|
| 519 | $result = $this->db->query($sql, $limit, $start); |
|
| 520 | if (!$result) { |
|
| @@ 1586-1593 (lines=8) @@ | ||
| 1583 | if (isset($criteria) && is_subclass_of($criteria, 'criteriaelement')) { |
|
| 1584 | $whereClause = $criteria->renderWhere(); |
|
| 1585 | ||
| 1586 | if ($whereClause !== 'WHERE ()') { |
|
| 1587 | $sql .= ' ' . $criteria->renderWhere(); |
|
| 1588 | if ($criteria->getSort() != '') { |
|
| 1589 | $sql .= ' ORDER BY ' . $criteria->getSort() . ' ' . $criteria->getOrder(); |
|
| 1590 | } |
|
| 1591 | $limit = $criteria->getLimit(); |
|
| 1592 | $start = $criteria->getStart(); |
|
| 1593 | } |
|
| 1594 | } |
|
| 1595 | ||
| 1596 | //echo "<br />" . $sql . "<br />"; |
|