+ finish task #337.

This commit is contained in:
wangchunsheng
2010-11-22 13:35:23 +00:00
parent 2d4dec1210
commit 2ab73ed5bf
4 changed files with 83 additions and 46 deletions

View File

@@ -217,6 +217,21 @@ class projectModel extends model
->fetchAll();
}
/**
* Get projects lists grouped by product.
*
* @access public
* @return array
*/
public function getProductGroupList()
{
return $this->dao->select('t1.id, t1.name, t2.product')->from(TABLE_PROJECT)->alias('t1')
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.id = t2.project')
->where('t1.deleted')->eq(0)
->orderBy('t1.id')
->fetchGroup('product');
}
/**
* Get project by id.
*