* fix the bug #274 and finish the task #635.

This commit is contained in:
shiyangyangwork@yahoo.cn
2011-12-23 02:37:48 +00:00
parent afcc39361b
commit bdb3f05673
2 changed files with 9 additions and 0 deletions

View File

@@ -193,6 +193,13 @@ class productModel extends model
return $pairs;
}
/**
* Get products by project.
*
* @param int $projectID
* @access public
* @return array
*/
public function getProductsByProject($projectID)
{
return $this->dao->select('t1.product, t2.name')

View File

@@ -701,6 +701,7 @@ class storyModel extends model
*/
public function getBySearch($productID, $queryID, $orderBy, $pager)
{
$products = $this->loadModel('product')->getPairs();
$query = $queryID ? $this->loadModel('search')->getQuery($queryID) : '';
/* Get the sql and form status from the query. */
@@ -719,6 +720,7 @@ class storyModel extends model
$storyQuery = str_replace($allProduct, '1', $this->session->storyQuery);
$queryProductID = 'all';
}
$storyQuery = $storyQuery . 'AND `product`' . helper::dbIN(array_keys($products));
return $this->getBySQL($queryProductID, $storyQuery, $orderBy, $pager);
}