SProductCommonTopic.php 755 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. class SProductCommonTopic extends MyActiveRecord {
  3. public static function model($className = __CLASS__)
  4. {
  5. return parent::model($className);
  6. }
  7. public function tableName()
  8. {
  9. return 'product_common_topic';
  10. }
  11. /**
  12. * 共性题数据
  13. * @param $examId
  14. * @param $isMethod //是否方法共性
  15. * @return array|null
  16. */
  17. public function getCommonTopic($examId, $isMethod=1){
  18. $criteria = new CDbCriteria();
  19. $criteria->select = 'template_id,template_no,topic_id';
  20. $criteria->addCondition('exam_id='.$examId);
  21. $criteria->addCondition('is_action='.$isMethod);
  22. $criteria->order = 'template_no ASC';
  23. return $this->findAll($criteria);
  24. }
  25. }