# 新增“教学总结”
## 新增“教学总结”功能
“教学总结”的功能点与“教学计划”完全一样,只是名字不同而已
![](https://box.kancloud.cn/b3094e1d1d86c3bd9eeacf743f23908e_1174x755.png)
## 教学计划分析
http://ketang.test/index.php?r=teachingV3/teachingPlan
*D:\wamp\www\ketang.test\weike\protected\modules\teachingV3\controllers\TeachingPlanController.php*
```
public function actionIndex(){
$uid = Yii::app()->user->id;
$schoolMap = UserService::factory()->getSchoolMapByUserID($uid);
if(!$schoolMap)
$this->redirect_msgBox('/',array('msg'=>'请先设置所属学校'));
$termList = V3SystemService::factory()->getSchoolTermList($schoolMap->fdSchoolID);
if(Yii::app()->user->fdTypeID == WK::TEACHER_TYPE_ID){
$userInfo = $this->_getUserGradeAndSubject($uid);
if(array_filter(array_unique($userInfo['grade']))){
$grades = array_intersect_key(Yii::app()->params['GRADE_LIST'],array_flip(array_filter(array_unique($userInfo['grade']))));
}else{
$grades = array();
}
if(array_filter(array_unique($userInfo['subject']))){
$subjects = array_intersect_key(Yii::app()->params['SUBJECT_ARR'],array_flip(array_filter(array_unique($userInfo['subject']))));;
}else{
$subjects = array();
}
}else{
$classMaps = ClassService::factory()->getAllClassByUserID($uid);
if($classMaps){
foreach ($classMaps as $classMap){
$grade[] = $classMap->fdGradeID;
}
}else{
$this->redirect_msgBox('/',array('msg'=>'请先加入班级'));
}
$grades = array_intersect_key(Yii::app()->params['GRADE_LIST'],array_flip($grade));
$subjects = Yii::app()->params['SUBJECT_ARR'];
}
$timestamp = time()*1000;
$this->render('index',array('data'=>CJSON::encode(array('termList'=>$termList,'grades'=>$grades,'subjects'=>$subjects,'timestamp'=>$timestamp))));
}
```
http://ketang.test/index.php?r=teachingV3/teachingPlan/GetPlanList&termID=&gradeID=&subjectID=&start=0&len=10&type=1
```
public function actionGetPlanList()
{
$params = RequestUtils::requestToArray(true);
$userID = Yii::app()->user->id;
$userInfo = $this->_getUserGradeAndSubject($userID);
if(Yii::app()->user->fdTypeID == WK::TEACHER_TYPE_ID){
$args['userID'] = $userID;
$args['subject'] = $params['subjectID']?:$userInfo['subject'];
}elseif(Yii::app()->user->fdTypeID == WK::STUDENT_TYPE_ID){
$args['userID'] = $userID;
$args['subject'] = $params['subjectID'];
}else{
$type = null;
$args['subject'] = $params['subjectID'];
}
$args['gradeID'] = $params['gradeID']?:$userInfo['grade'];
// $type = null;
$schoolMap = UserService::factory()->getSchoolMapByUserID($userID);
if(!$schoolMap)
ResponseUtils::json(null,21,"学校未设置");
$args['type'] = $params['type'];
$args['termID'] = $params['termID'];
$args['schoolID'] = $schoolMap->fdSchoolID;
$args['permission'] = $params['type'] == 0 ? WK::SHARING_OPEN : null;
$args['disabled'] = WK::CNT_ENABLE;
$count = PlanningService::factory()->countPlannings($args);
$args['length'] = $params['len']?:10;
$args['start'] = $params['start']?:0;
$plans = PlanningService::factory()->getPlannings($args);
$planData['list'] = $this->_getPlanData($plans);
$planData['total'] = $count;
ResponseUtils::json(array('data'=>$planData));
}
```
### 获取教学计划列表的criteria
```php
/**
* 获取教学计划列表的criteria
* @param array $args;
* $args['userID'] 老师ID
* $args['type'] 1:userID的原创 2:userID的收藏
* $args['startTime'] 开始时间
* $args['endTime'] 结束时间
* $args['length'] 获取条目个数
* $args['start'] 开始的下标
* $args['keyword'] 关键字
* $args['seek'] (array)筛选条件
* $author Liuzhiqiang 2014年1月2日
*/
public function findPlannings($args)
{
$criteria = new CDbCriteria();
$withArr = array();
$criteria->alias = 'planing'; // 别名
CDbUtils::addCondition($criteria,"planing.id",$args['id']);
if ($args['keyword']) {
$criteria->addSearchCondition('planing.fdName',$args['keyword'],true); //支持模糊查找
$criteria->addSearchCondition("mainUser.fdRealName", $args['keyword'],true,'OR');
}
CDbUtils::addCondition($criteria,"planing.fdDisabled",$args['disabled']);
if ($args['type']) {
if ($args['type'] == 1) { //需用常量表示
$withArr[] = 'mainContribute';
$criteria->addCondition('mainContribute.fdUserID =' . $args['userID']);
} elseif ($args['type'] == 2) {
$withArr['favourite'] = array("together" => true);
$criteria->addCondition('favourite.fdUserID =' . $args['userID']);
}
}
if($args['textbook']){//教材
$withArr[] = 'textbook';
CDbUtils::addCondition($criteria,"textbook.fdValue",$args['textbook']);
}else if($args['version']){//版本
$withArr[] = 'version';
CDbUtils::addCondition($criteria,"version.fdValue",$args['version']);
}else{
if($args['schoolType']){//学段
$withArr[] = 'schoolType';
CDbUtils::addCondition($criteria,"schoolType.fdValue",$args['schoolType']);
}
if($args['subject']){//科目
$withArr[] = 'subtype';
CDbUtils::addCondition($criteria,"subtype.fdValue",$args['subject']);
}
}
if($args['gradeID']){//年级
$withArr[] = 'grdtype';
CDbUtils::addCondition($criteria,"grdtype.fdValue",$args['gradeID']);
}
if($args['termID']){//学期
$withArr[] = 'termtype';
CDbUtils::addCondition($criteria,"termtype.fdValue",$args['termID']);
}
if(isset($args['permission'])){//查看权限
$withArr[] = 'mainContribute';
CDbUtils::addCondition($criteria,"mainContribute.fdPermission",$args['permission']);
}
if(isset($args['schoolID'])){//查看权限
$withArr[] = 'mainUser.schoolMap';
CDbUtils::addCondition($criteria,"schoolMap.fdSchoolID",$args['schoolID']);
}
if($args['classes']){
$withArr[] = 'planningClass';
CDbUtils::addCondition($criteria,"planningClass.fdValue",$args['classes']);
}
if($args['length']){
$criteria->limit = $args['length'];
}
if($args['start']){
$criteria->offset = $args['start'];
}
if($args['timeStart']){
$criteria->addCondition("planing.fdCreate>=:start");
$criteria->params[":start"] = $args['timeStart'];
}
if($args['timeEnd']){
$criteria->addCondition("planing.fdCreate<:end");
$criteria->params[":end"] = $args['timeEnd'];
}
$criteria->addCondition('planing.fdTypeID =' . WK::PLAN_TYPE_ID); // 常量29
$criteria->order = 'UNIX_TIMESTAMP(planing.fdCreate) desc'; // 按创建的时间戳排序
$criteria->with = array_unique($withArr);
$criteria->group = 'planing.id';
return $criteria;
}
```
### D:\wamp\www\ketang.test\weike\protected\models\content\Content.php
```php
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'contributes' => array(self::BELONGS_TO, 'Contribute', '', 'on' => 't.id=contributes.fdContentID', 'select' => array('contributes.fdContentID', 'contributes.fdUserID', 'contributes.fdStatus')),
'users' => array(self::BELONGS_TO, 'User', '', 'on' => 'users.id=contributes.fdUserID', 'select' => array('users.id', 'users.fdLogin', 'users.fdCardID', 'users.fdTypeID', 'users.fdName','users.fdRealName')),
//题目难度指数
'diff' => array(self::HAS_ONE, 'Integer', 'fdContentID', 'on' => 'diff.fdAttributeID=' . WK::DIFF_ATTR_ID, 'select' => array('diff.fdValue')),
//标签
'tags' => array(self::HAS_MANY, 'Text', 'fdContentID', 'on' => 'tags.fdAttributeID=' . WK::TAG_ATTR_ID, 'order' => 'tags.id', 'select' => array('tags.id', 'tags.fdValue')),
//简介
'intro' => array(self::HAS_ONE, 'Blob', 'fdContentID', 'on' => 'intro.fdAttributeID=' . WK::SUMMARY_ATTR_ID, 'select' => array('intro.fdValue')),
//@Deprecated 学段
'schtype' => array(self::HAS_ONE, 'Integer', 'fdContentID', 'on' => 'schtype.fdAttributeID=' . WK::SECTION_ATTR_ID, 'select' => array('schtype.fdValue')),
//科目
'subtype' => array(self::HAS_ONE, 'Integer', 'fdContentID', 'on' => 'subtype.fdAttributeID=' . WK::SUJT_ATTR_ID, 'select' => array('subtype.fdValue')),
//学期 add by zhangjsh 2013-8-2
'termtype' => array(self::HAS_ONE, 'Integer', 'fdContentID', 'condition' => 'termtype.fdAttributeID=' . WK::TERM_ATTR_ID, 'select' => array('termtype.fdValue')),
//知识点
'knowtype' => array(self::HAS_MANY, 'Integer', 'fdContentID', 'condition' => 't.fdAttributeID=' . WK::KONW_ATTR_ID, 'select' => array('t.fdValue'), 'alias' => 't', 'with' => array('tag'), 'order' => 't.id asc'),
'knowTypes' => array(self::HAS_MANY, 'Integer', 'fdContentID', 'condition' => 'knowTypes.fdAttributeID=' . WK::KONW_ATTR_ID),
//章
'edtiontype' => array(self::HAS_MANY, 'Integer', 'fdContentID', 'condition' => 't.fdAttributeID=' . WK::CHAPTER_ATTR_ID, 'select' => array('t.fdValue'), 'alias' => 't', 'with' => array('tag'), 'order' => 't.id asc'),
//版本
'version' => array(self::HAS_ONE, 'Integer', 'fdContentID', 'condition' => 't.fdAttributeID =' . WK::VER_ATTR_ID, 'select' => array('t.fdValue'), 'alias' => 't', 'with' => array('ver')),
'v2version' => array(self::HAS_ONE, 'Integer', 'fdContentID', 'condition' => 'v2version.fdAttributeID =' . WK::VER_ATTR_ID, 'select' => array('v2version.fdValue')),//add 2016-3-2 lpf
//教材
'textbook' => array(self::HAS_ONE, 'Integer', 'fdContentID', 'condition' => 't.fdAttributeID =' . WK::TEXTBOOK_ATTR_ID, 'select' => array('t.fdValue'), 'alias' => 't', 'with' => array('tag')),
//地区
'area' => array(self::HAS_MANY, 'Integer', 'fdContentID', 'condition' => 't.fdAttributeID =' . WK::AREA_ATTR_ID, 'select' => array('t.fdValue'), 'alias' => 't', 'with' => array('loca')),
// add bu 2013.6.18
//学段
'schoolType' => array(self::HAS_ONE, 'Integer', 'fdContentID', 'on' => 'schoolType.fdAttributeID=' . WK::SECTION_ATTR_ID, 'select' => array('schoolType.fdContentID,schoolType.fdValue')),
//播放次数
'playNum' => array(self::HAS_ONE, 'Integer', 'fdContentID', 'condition' => 'playNum.fdAttributeID=' . WK::VIDEO_PLAY_TOTAL),
//@Deprecated 播放次数 使用playNum
'wkPlayNum' => array(self::HAS_ONE, 'Integer', '', 'on' => 'wkPlayNum.fdContentID=id and wkPlayNum.fdAttributeID=' . WK::VIDEO_PLAY_TOTAL),
//@Deprecated 内容贡献记录 使用mainContribute
'wkContribute' => array(self::HAS_ONE, 'Contribute', '', 'on' => 'wkContribute.fdContentID=t.id and wkContribute.fdFileID=0 and wkContribute.fdStatus=1'),
//@Deprecated 内容贡献者记录 使用mainUser
'wkUser' => array(self::HAS_ONE, 'User', 'fdUserID', 'through' => 'wkContribute'),
//@Deprecated add by hecf 2013.5.21 查询视频播放次数 使用playNum
'videoPlay' => array(self::HAS_ONE, 'Integer', 'fdContentID', 'condition' => 'videoPlay.fdAttributeID=' . WK::VIDEO_PLAY_TOTAL, 'select' => array('videoPlay.fdValue')),
//题目
'exercises' => array(self::HAS_ONE, 'Exercise', 'fdContentID'),
//题目对应的类型
'exerciseType' => array(self::BELONGS_TO, 'ExerciseType', '', 'on' => 'exercises.fdExerciseTypeID=exerciseType.id'),
//题目对应的内容
'exerciseItem' => array(self::HAS_MANY, 'ExerciseItem', '', 'on' => 'exercises.id=exerciseItem.fdExerciseID'),
//@Deprecated 查找file对应的属性relation
'file' => array(self::HAS_ONE, 'File', 'fdContentID'), //hecf 2013.5.25
//@Deprecated 查找integer对应的属性relation
'integer' => array(self::HAS_ONE, 'Integer', 'fdContentID'),
//@Deprecated 科目 edit by chenxch
'subject' => array(self::HAS_ONE, 'Subject', 'fdValue', 'through' => 'integer', 'on' => 'integer.fdAttributeID=' . WK::SUJT_ATTR_ID),
//@Deprecated
'class' => array(self::HAS_ONE, 'Integer', 'fdContentID'),
//@Deprecated
'grade' => array(self::HAS_ONE, 'Grade', 'fdValue', 'through' => 'class'),
//@Deprecated 查找blob对应的属性relation
'blob' => array(self::HAS_ONE, 'Blob', 'fdContentID'),
'blobs' => array(self::HAS_MANY, 'Blob', 'fdContentID'),
//@Deprecated 使用playNum
'play' => array(self::BELONGS_TO, 'Play', '', 'on' => 't.id=play.fdContentID'),
//专题是否分将次,0为不分,1为分 by chenzsh
'courseComp' => array(self::HAS_ONE, 'Integer', 'fdContentID', 'on' => 'courseComp.fdAttributeID=' . WK::COURSE_COMP_ID, 'select' => array('courseComp.fdValue')),
/*add by john 2013年6月5日*/
//查询content年级属性
'grdtype' => array(self::HAS_ONE, 'Integer', 'fdContentID', 'condition' => 'grdtype.fdAttributeID=' . WK::GRD_ATTR_ID, 'select' => array('grdtype.fdValue')),
//@Deprecated微课-知识点关联
'ctntagindex' => array(self::HAS_MANY, 'wkeCtnTagIndex', '', 'on' => 'id=ctntagindex.fdContentID', 'joinType' => 'LEFT JOIN'),
//主内容 2013年6月7日
'mainContribute' => array(self::HAS_ONE, 'Contribute', 'fdContentID', 'on' => 'mainContribute.fdFileID = 0'),
'mainUser' => array(self::HAS_ONE, 'User', 'fdUserID', 'through' => 'mainContribute'),
//新relation,应对试卷的contribute.fdFileID 不等于 0 by dengjq 2015-2-6
'newContribute' => array(self::HAS_ONE, 'Contribute', "fdContentID"),
'newUser' => array(self::HAS_ONE, 'User', 'fdUserID', 'through' => 'newContribute'),
//专题 john 2013年6月22日 | modify by chenzsh 2014年6月10日
'course'=>array(self::HAS_MANY,'ctnSubject','fdSubjectID','order'=>'course.fdOrder ASC'),
//专题中的微课 john 2013年6月22日
'coursewk'=>array(self::HAS_MANY,'ctnSubject','fdContentID'),
//专题价钱 hecf 2013.6.27
'price'=>array(self::HAS_ONE,'Price','fdContentID'),
//好评 hecf 2013.6.28
'AGREENUM'=>array(self::HAS_ONE,'Integer','fdContentID','condition'=>'AGREENUM.fdAttributeID='.WK::GOOD_COMMENT_ATTR_ID),
//差评 hecf 2013.6.28
'OBJECTNUM'=>array(self::HAS_ONE,'Integer','fdContentID','condition'=>'OBJECTNUM.fdAttributeID='.WK::BAD_COMMENT_ATTR_ID),
//我收藏的
'favourite' =>array(self::HAS_MANY,'Favorite','fdContentID'), //我的收藏 hecf 2013-7-8
//收藏次数 by yemg 5/29/2014
'cntFavor' =>array(self::STAT,'Favorite','fdContentID'),
//班级日志
'clsCtnIndex'=>array(self::HAS_ONE,'wkeClsCtnIndex','fdContentID'),
'clsCtnIndexes'=>array(self::HAS_MANY,'wkeClsCtnIndex','fdContentID'),//by dengjq 2015-8-22 主题讨论
//试卷 chengx 2013/7/18
'exam'=>array(self::HAS_ONE,'Exam','fdContentID'),
//真实姓名
'realName'=>array(self::HAS_ONE,'Card','fdCardID','through'=>'mainUser'),
'albumCover'=>array(self::HAS_ONE,'Text','fdContentID','on'=>'albumCover.fdAttribute='.WK::ALBUM_COVER), //相册封面 author:cenyc
'photo'=>array(self::HAS_MANY,'File','fdContentID','on'=>'photo.fdTypeID='.WK::CLASS_ALBUM),//hecf 2013.5.25
'albumInfo'=>array(self::HAS_ONE,'Blob','fdContentID','on'=>'albumInfo.fdAttributeID='.WK::ALBUM_INFO),
//题目 标签
'tag'=>array(self::BELONGS_TO,'Text','','on'=>'t.id=tag.fdContentID and tag.fdAttributeID='.WK::TAG_ATTR_ID),
'difficulty'=>array(self::HAS_ONE,'Integer','','on'=>'t.id=difficulty.fdContentID and difficulty.fdAttributeID='.WK::DIFF_ATTR_ID),
'other'=>array(self::BELONGS_TO,'Integer','','on'=>'t.id=other.fdContentID'),
//专题封面图片
'coverImage'=>array(self::HAS_ONE,'Text','fdContentID','on'=>'coverImage.fdAttributeID='.WK::COURSE_ATTR_ID),
'courseSubject'=>array(self::HAS_ONE,'Subject','fdValue','select'=>array('courseSubject.fdName'),'on'=>'integer.fdAttributeID='.WK::SUJT_ATTR_ID,'through'=>'integer'),
//微课与tag关系 by john 2013年7月25日
'ctnTagIndex'=>array(self::HAS_MANY,'wkeCtnTagIndex','fdContentID'),
'tagIndexes1'=>array(self::HAS_MANY,"wkeCtnTagIndex","fdContentID","on"=>"tagIndexes1.fdType=1"),//教材-章-节
'tagIndexes2'=>array(self::HAS_MANY,"wkeCtnTagIndex","fdContentID","on"=>"tagIndexes2.fdType=2"),//各级知识点
//总评论数 hecf 2013.8.14
'wkCommentCount'=>array(self::HAS_ONE,'Integer','fdContentID','condition'=>'wkCommentCount.fdAttributeID='.WK::COMMENT_ATTR_ID),
//chengx 获取科目
'subjects'=>array(self::HAS_ONE,'Integer','fdContentID','condition'=>'subjects.fdAttributeID='.WK::SUJT_ATTR_ID,'select'=>array('subjects.fdValue')),
'_subject'=>array(self::HAS_ONE,'Integer','fdContentID','on'=>'_subject.fdAttributeID='.WK::SUJT_ATTR_ID),
'wkfile'=>array(self::HAS_ONE,'File','fdContentID','condition'=>'wkfile.fdTypeID='.WK::VIDEO_TYPEID),
'logfile'=>array(self::HAS_MANY,'File','fdContentID','condition'=>'logfile.fdTypeID='.WK::FILE_TYPE_ATTACHMENT),
'wkIndex'=>array(self::HAS_ONE,'Indexs','fdContentID'),//微课关联类型
//@Deprecated by john 2013年10月11日 使用version
'wkversion'=>array(self::HAS_ONE, 'Integer', '', 'on'=>'wkversion.fdContentID=t.id and wkversion.fdAttributeID='.WK::VER_ATTR_ID),
//by hecf 2013.10.17 内容权限设置类型(原创/转载)
'wkType'=>array(self::HAS_ONE,'Integer','fdContentID','on'=>'wkType.fdAttributeID='.WK::AUTHORITY_ATTR_ID),
//by hecf 2013.10.23 收藏数
'collection'=>array(self::HAS_ONE,'Integer','fdContentID','on'=>'collection.fdAttributeID='.WK::COLLECTION_ATTR_ID),
//by chenzsh 2013.11.6 历史播放
'hisPlay'=> array(self::HAS_ONE,'Play','fdContentID','condition'=>'hisPlay.fdExcluded is null','select'=>array('MAX(hisPlay.fdTime) as playTime'),'order'=>'playTime DESC'),
//by zhangxb 2013.12.10 微课参赛状态
'wkeTourney'=>array(self::HAS_ONE,'wkeTourney','fdContentID','select'=>array('wkeTourney.fdStage')),
//by liuzhiqiang 2014年3月27日 学生学习计划
'planningClass'=>array(self::HAS_ONE,'Integer','fdContentID','on'=>'planningClass.fdAttributeID = '.WK::CLASS_RETHINK_ATTR_ID),
//by yemg 4/15/2014 courseware file 课件
'cswFile'=>array(self::HAS_ONE,'File','fdContentID','condition'=>'cswFile.fdTypeID='.WK::REPOSITORY_COURSEWARE),
//by yemg 4/15/2014 solution file 教案
'solFile'=>array(self::HAS_ONE,'File','fdContentID','condition'=>'solFile.fdTypeID='.WK::REPOSITORY_SOLUTION),
//by yemg 4/15/2014 guide learn case file 导学案
'gdFile'=>array(self::HAS_ONE,'File','fdContentID','condition'=>'gdFile.fdTypeID='.WK::REPOSITORY_GUIDE),
//by tangjf微课和专题获取评价平均分
'avgRark'=>array(self::HAS_ONE,'Integer','fdContentID','on'=>'avgRark.fdAttributeID='.WK::RANKEDAVG_ATTR_ID),
//by tangjf微课和专题获取评价数量
'countRark'=>array(self::HAS_ONE,'Integer','fdContentID','on'=>'countRark.fdAttributeID='.WK::RANKEDTOTAL_ATTR_ID),
//微课封面 by yemg 6/5/2014
'wkCover'=>array(self::HAS_ONE,'Text','fdContentID','on'=>'wkCover.fdAttributeID='.WK::WK_ATTR_ID,'select'=>array('wkCover.fdValue')),
//资源库模块中微课为解题类型时的试题来源 by yemg 6/5/2014
'examSrc'=>array(self::HAS_ONE,'Text','fdContentID','on'=>'examSrc.fdAttributeID='.WK::EXAM_SOURCE_ATTR_ID,'select'=>array('examSrc.fdValue')),
//内容权限为转载类型时的转载来源 by yemg 6/5/2014
'reprintSrc'=>array(self::HAS_ONE,'Text','fdContentID','on'=>'reprintSrc.fdAttributeID='.WK::REPRINTED_ATTR_ID,'select'=>array('reprintSrc.fdValue')),
//试题知识类型 bytang tangf 2014-6-16
'knowType'=>array(self::HAS_ONE,'Integer','fdContentID','on'=>'knowType.fdAttributeID='.WK::RESOURCE_ST_KNOW),
//试题目标类型 bytang tangf 2014-6-16
'knowTarget'=>array(self::HAS_ONE,'Integer','fdContentID','on'=>'knowTarget.fdAttributeID='.WK::RESOURCE_ST_OBJECTIVES),
'textbooks'=>array(self::HAS_ONE,'Integer','fdContentID','condition'=>'textbooks.fdAttributeID ='.WK::TEXTBOOK_ATTR_ID,'select'=>array('textbooks.fdValue')),
//chenchy 2014/6/23
'year'=>array(self::HAS_ONE,'Integer','fdContentID','on'=>'year.fdAttributeID='.WK::EXAM_FOR_YEAR),
//andy 2014年6月24日 试卷适用年份
//课程进度,by dengjq/2014-7-9
'courseSchedules'=>array(self::HAS_MANY,'wkeCourseSchedule','fdCourseID','condition'=>'courseSchedules.fdTypeID='.WK::SCHEDULE_COURSE),
//资源下载次数 add tangjf 2014-7-16
'downloadsNum'=>array(self::HAS_ONE,'Integer','fdContentID','condition'=>'downloadsNum.fdAttributeID ='.WK::DOWNLOADS_NUM,'select'=>array('downloadsNum.fdValue')),
//根据资源下载次数排序 add by wuzhc 2015-08-13
'orderByDownNum'=>array(self::HAS_ONE,'Integer','fdContentID','on'=>'orderByDownNum.fdAttributeID ='.WK::DOWNLOADS_NUM,'select'=>array('orderByDownNum.fdValue')),
//内容关联的所有文件 yemg 7/31/2014
'files' => array(self::HAS_MANY, 'File', 'fdContentID'),
//yemg 7/31/2014
'ctnMaps' => array(self::HAS_MANY, 'wkeCtnMap', 'fdContentID'),
'ctnMaps2' => array(self::HAS_MANY, 'wkeCtnMap', 'fdTargetID'),
//yemg 8/26/2014
'cntFile' =>array(self::STAT,'File','fdContentID'),
//by chenzsh 2014-9-9 14:33:57
'xtcourse'=>array(self::HAS_MANY,'ctnSubject','fdSubjectID','order'=>'xtcourse.fdOrder ASC','condition'=>'xtcourse.fdXtStatus = 0'),
'ktcourse'=>array(self::HAS_MANY,'ctnSubject','fdSubjectID','order'=>'ktcourse.fdOrder ASC','condition'=>'ktcourse.fdKtStatus = 0'),
//by dengjq/2014-10-13
'products'=>array(self::HAS_MANY,'payProduct','fdContentID'),//推送成产品
'newest_product'=>array(self::HAS_ONE,'payProduct','fdContentID','order'=>'newest_product.fdCreate DESC'),//获取最新产品 by chenxch
'productXuetang'=>array(self::HAS_ONE,'payProduct','fdContentID','on'=>'productXuetang.fdSourceID='.WK::WEB_XUETANG,"order"=>"productXuetang.id desc"),//推送成产品,学堂
//for test by john 用于调试数据库中content有内容而exercise没有内容的题目
'exercise'=>array(self::HAS_ONE,'Exercise',"fdContentID"),
//by tangjf/2014-10-29
//版本
'versions'=>array(self::HAS_ONE,'Integer','fdContentID','condition'=>'versions.fdAttributeID ='.WK::VER_ATTR_ID,'select'=>array('versions.fdValue')),
//教材
'textbooks'=>array(self::HAS_ONE,'Integer','fdContentID','condition'=>'textbooks.fdAttributeID ='.WK::TEXTBOOK_ATTR_ID,'select'=>array('textbooks.fdValue')),
//--Text
"reviewReason"=>array(self::HAS_ONE,"Text","fdContentID","on"=>"reviewReason.fdAttributeID=".WK::TEXT_REVIEW_REASON),
//content对应使用数
'used' => array(self::HAS_ONE,"Integer","fdContentID","on"=>"used.fdAttributeID=".Yii::app()->params['USED_ATTR_ID']),
//音频
'audiofile'=>array(self::HAS_ONE,'File','fdContentID','condition'=>'audiofile.fdTypeID='.WK::AUDIO_TYPEID),
//图片
'imageFile'=>array(self::HAS_ONE,'File','fdContentID','condition'=>'imageFile.fdTypeID='.WK::IMAGE_TYPEID),
//题目点评 by dengjq 2015-6-12
'markTexts'=>array(self::HAS_MANY,"Text","fdContentID","on"=>"markTexts.fdAttributeID>=".WK::TEXT_EXERCISE_MARK1." and markTexts.fdAttributeID<=".WK::TEXT_EXERCISE_MARK4),
//题目关联考点 by dengjq 2015-6-18
'pointInteger'=>array(self::HAS_ONE,"Integer","fdContentID","on"=>"pointInteger.fdAttributeID=".WK::XT_POINT_ID),
//外部应用ID by john 2015-08-12
'outSideHost'=>array(self::HAS_ONE,'Integer','fdContentID','on'=>'outSideHost.fdAttributeID='.WK::OUTSIDE_HOST),
'outSideWeiID'=>array(self::HAS_ONE,'Integer','fdContentID','on'=>'outSideWeiID.fdAttributeID='.WK::OUTSIDE_WKID),
//试卷的源试卷ID by john 2015-08-26
"sourceExam"=>array(self::HAS_ONE,"Integer",'fdContentID',"on"=>"sourceExam.fdAttributeID=".WK::SOURCEEXAM_ATTR_ID),
"quality"=>array(self::HAS_ONE,"Integer","fdContentID","on"=>"quality.fdAttributeID=".WK::INTEGER_QUALITY),//资源质量 by dengjq 2015-10-26
"subSubject"=>array(self::HAS_ONE,"Integer","fdContentID","on"=>"subSubject.fdAttributeID=".WK::INTEGER_SUB_SUBJECT),//子科目 by dengjq 2015-10-26
"exerciseAlias"=>array(self::HAS_ONE, "Integer", "fdContentID","on"=>"exerciseAlias.fdAttributeID=".WK::XT_TYPE_ID),//aliasID题型
"exerciseTag"=>array(self::HAS_ONE, "Integer", "fdContentID","on"=>"exerciseTag.fdAttributeID=".WK::XT_POINT_ID),//题目题型对应的考点
//试卷的难度构成 by tangjf 2016-5-12
"diffSituation"=>array(self::HAS_ONE,"Text","fdContentID","on"=>"diffSituation.fdAttributeID=".WK::EXAM_DIFF_SITUATION),
//试卷的试题总数
"exerciseCount"=>array(self::HAS_ONE,"Text","fdContentID","on"=>"exerciseCount.fdAttributeID=".WK::EXAM_EXERCISE_COUNT),
//学科网的题目ID
"exerciseXkID"=>array(self::HAS_ONE,"Integer","fdContentID","on"=>"exerciseXkID.fdAttributeID=".WK::EXERCISE_XUEKEWANG_ID),
//学科网资源ID
"xkwID"=>array(self::HAS_ONE,"Integer","fdContentID","on"=>"xkwID.fdAttributeID=".WK::XUEKEWANG_ID),
//资源推送到mongo的状态值
"resourceMongo"=>array(self::HAS_ONE,"Integer","fdContentID","on"=>"resourceMongo.fdAttributeID=".WK::RESOURCE_MONGO),
// 第三版备课课时
'period' => array(self::HAS_ONE,'Integer','fdContentID','condition'=>'period.fdAttributeID ='.WK::PREPARE_ATTR_PERIOD,'select'=>array('period.fdValue')),
// 第三版备课课型
'prepareType' => array(self::HAS_ONE,'Integer','fdContentID','condition'=>'prepareType.fdAttributeID ='.WK::PREPARE_ATTR_TYPE,'select'=>array('prepareType.fdValue')),
// 第四版备课(是否在线提交作业)
'uploadHomework' => array(self::HAS_ONE,'Integer','fdContentID','condition'=>'uploadHomework.fdAttributeID ='.WK::INTEGER_V4PREPARE_UPLOAD_HOMEWORK,'select'=>array('uploadHomework.fdValue')),
// 第四版备课(需登记线下作业成绩)
'registerScore' => array(self::HAS_ONE,'Integer','fdContentID','condition'=>'registerScore.fdAttributeID ='.WK::INTEGER_V4PREPARE_REGISTER_SCORE,'select'=>array('registerScore.fdValue')),
// @deprecated 第三版备课草稿状态, 使用content字段disabled判断 see WK::CNT_PREPARE_DRAFT
// 'prepareDraft'=>array(self::HAS_ONE,'Integer','fdContentID','condition'=>'prepareDraft.fdAttributeID='.WK::PREPARE_ATTR_DRAFT),
//多版本
'_versions' => array(self::HAS_MANY, 'Integer', 'fdContentID', 'condition' => '_versions.fdAttributeID=' . WK::VER_ATTR_ID),
//点赞 by tangjf 2016-12-6
'appraise' =>array(self::HAS_MANY,'svcAppraise','fdContentID'),
//点赞次数
'appraiseNum' =>array(self::STAT,'svcAppraise','fdContentID'),
'wktokt' => array(self::HAS_ONE, 'wkeWKTOKT', 'fdKTWKID', 'on' => 't.id=wktokt.fdKTWKID'),
'ctnAtagIndex'=>array(self::HAS_MANY,'wkeCtnAtagIndex','fdContentID'),
'coverFile'=>array(self::HAS_ONE,'File','fdContentID','on'=>'coverFile.fdTypeID='.WK::FILE_TYPE_PICTURE),
//微课播放生成推送的相关试题
'weikeExams' => array(self::HAS_MANY,'Integer','fdContentID','condition' => 'weikeExams.fdAttributeID=' . WK::WEIKE_ATTRIBUTE_TYPE),
'answerExams' => array(self::HAS_MANY,'AnswerExam','','on'=>'weikeExams.fdValue = answerExams.id','through' => 'weikeExams'),
'province' => array(self::HAS_ONE, 'Integer', 'fdContentID', 'on' => 'province.fdAttributeID =' . WK::AREA_ATTR_ID),
'courses'=>array(self::HAS_MANY,'ctnSubject','fdSubjectID'),
'explainWeike' => array(self::HAS_MANY,'Integer','fdContentID','condition' => 'explainWeike.fdAttributeID=' . WK::EXAM_EXPLAIN_WEIKE),
//奖项
'awards' => array(self::HAS_ONE,'Text','fdContentID','condition' => 'awards.fdAttributeID=' . WK::ATTRIBUTE_AWARDS),
//作品内容
'productionText' => array(self::HAS_ONE, 'Blob', 'fdContentID', 'on' => 'productionText.fdAttributeID=' . WK::BLOB_TEXT, 'select' => array('intro.fdValue')),
//地区关联
'member' => array(self::HAS_ONE,'Member','','on'=>'t.fdUserID = member.fdUserID'),
//班级关联
'classMapOne'=> array(self::HAS_ONE,'wkeClassMap','','on'=>'t.fdUserID = wkeClassMap.fdUserID'),
//公开分享审核
"openShareApprove"=>array(self::HAS_ONE,"Integer","fdContentID","on"=>"openShareApprove.fdAttributeID=".WK::OPEN_SHARING_APPROVING),
);
}
```
http://ketang.test/index.php?r=teachingV3/teachingPlan/edit&planID=2145371
```
```
- 说明
- 开发任务
- 星课-真光
- 课表
- Excel Down
- 调课
- 课表修改
- 课表代码分析
- 课堂
- 课堂:应用商店通信管理协议
- 教师账号强制绑定手机或邮箱
- 强制绑定手机和修改密码的规则
- 学堂
- 课程学习:讨论功能
- 后台:课程讨论管理
- 课程直播接口
- 学习统计功能(旧版)
- 学习统计功能(新版)
- 同步课程统计功能
- 同步课程编辑-新增视频
- 第三方接口
- 学科网
- 安徽第三方
- 大赛
- 管控系统
- 日志管理
- 设备日志
- 平板接口
- 渝教
- 教学总结
- 空白目录
- Yii 1.1
- 学堂架构
- Yii 1.1一些方法的解读
- MVCS结构
- 基础使用语法
- 创建1个新模块
- 关联模型
- CDbCriteria
- 学生-课堂记录
- 学生端页面展示
- 教师端页面展示
- 编辑课程文档
- SQL
- 课堂项目运行入口
- 上传资源示意图
- 行为
- PHPStorm
- 源码阅读
- 会诊答卷页面
- 考点练习
- 资源首页
- 同步课程
- 同步课程:章节信息
- 升学复习
- 统计图-范例
- 模块
- 非法词
- 服务层
- MongoDB类
- 学堂作答记录从Mongo新集合获取数据
- MongoYii
- 错题集
- 小技巧
- 完善资料
- 邮件发送
- K12
- JSpang视频课程
- MongoDB
- 创业
- 项目
- 包包