* @package projectStory * @version $Id * @link https://www.zentao.net */ class projectstoryModel extends model { /** * Get the stories for execution linked. * * @param int $projectID * @param array $storyIdList * @access public * @return array */ public function getExecutionStories($projectID, $storyIdList = array()) { $stories = array(); $storyIdList = (array)$storyIdList; if(empty($storyIdList)) return $stories; return $this->dao->select('t2.id as id, t2.title as title, t3.id as executionID, t3.name as execution')->from(TABLE_PROJECTSTORY)->alias('t1') ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id') ->leftJoin(TABLE_EXECUTION)->alias('t3')->on('t1.project=t3.id') ->where('t1.story')->in($storyIdList) ->andWhere('t3.type')->in('sprint,stage,kanban') ->andWhere('t3.project')->eq($projectID) ->andWhere('t3.deleted')->eq(0) ->fetchAll('id'); } }