addInCondition('topic_id', $topicIds); $criteria->addCondition('`mode` = 1'); $criteria->order = 'topic_id ASC'; $result = array(); $query = getAttributes($this->findAll($criteria)); if ($query) { foreach ($query AS $k => $v) { $result[$v['topic_id']][] = $v; } } return $result; } }