1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- /**
- * @author: CeeFee
- * @description: 考试
- */
- class STopicItem extends MyActiveRecord
- {
- public static function model($className = __CLASS__)
- {
- return parent::model($className);
- }
-
- public function tableName()
- {
- return 'topic_item';
- }
-
- public function getTopicItems($topicIds)
- {
- $criteria = new CDbCriteria();
- $criteria->addInCondition('topic_id', $topicIds);
- $criteria->order = 'topic_id ASC, sort_order ASC';
-
- $result = array();
- $query = getAttributes($this->findAll($criteria));
-
- if ($query)
- {
- foreach ($query AS $k => $v)
- {
- $result[$v['topic_id']][] = $v;
- }
- }
-
- return $result;
- }
- }
|