ipd.php 938 B

12345678910111213141516171819202122232425
  1. <?php
  2. /**
  3. * @param object $pager
  4. * @param int $productID
  5. * @param string $branch
  6. * @param string $modules
  7. * @param string $type
  8. * @param string $orderBy
  9. */
  10. public function getFeedbackStories($productID, $branch, $modules, $type, $orderBy, $pager)
  11. {
  12. $sql = $this->dao->select("t1.*, IF(t1.`pri` = 0, {$this->config->maxPriValue}, t1.`pri`) as priOrder")->from(TABLE_STORY)->alias('t1');
  13. $stories = $sql->where('t1.product')->in($productID)
  14. ->andWhere('t1.deleted')->eq(0)
  15. ->andWhere('t1.vision')->eq($this->config->vision)
  16. ->andWhere('t1.type')->eq($type)
  17. ->andWhere('t1.feedback')->ne(0)
  18. ->beginIF($branch != 'all')->andWhere("t1.branch")->eq($branch)->fi()
  19. ->beginIF($modules)->andWhere("t1.module")->in($modules)->fi()
  20. ->orderBy($orderBy)
  21. ->page($pager)
  22. ->fetchAll('id');
  23. return $this->mergePlanTitleAndChildren($productID, $stories, $type);
  24. }