12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- /**
- * @author: CeeFee
- * @description: 考试
- */
- class SPaperTopicLarge extends MyActiveRecord
- {
- public static function model($className = __CLASS__)
- {
- return parent::model($className);
- }
-
- public function tableName()
- {
- return 'paper_topic_large';
- }
- /**
- * 获取试卷大题题信息
- * @param $paperId
- * @return array
- */
- public function getPaperLargeTopicInfo($paperId){
- $sql = "select large_topic_id,logic_type,logic_type_second,method_ids from ".$this->tableName()." where paper_id = {$paperId}";
- $info = $this->getCommandBuilder()->createSqlCommand($sql)->queryAll();
- $logicType = array();
- $largeTopicMethod = array();
- if($info){
- foreach($info as $value){
- if($value['logic_type_second'] > 0){
- $value['logic_type'] .= '_'.$value['logic_type_second'];
- }
- $logicType[$value['large_topic_id']] = $value['logic_type'];
- $largeTopicMethod[$value['large_topic_id']] = explode(',',$value['method_ids']);
- }
- unset($info);
- }
- return array($logicType,$largeTopicMethod);
- }
- }
|