# 微課資源
## 專題播放頁
@url repositories/play/course&courseID=2144550
```
/**
* 專題播放頁面
* @author wuzhc 2015-08-17
*/
public function actionCourse(){
$courseID = (int)RequestUtils::getNormalRequest('courseID');
$weikeID = (int)RequestUtils::getNormalRequest('weikeID');
$userID = Yii::app()->user->id;
//過濾數據 add by wuzhc 2016-02-18
if($courseID == 975778 || $courseID == 975474) {
if(BrowserUtils::isMobile()) {
echo header('location:http://xuetang.cnweike.cn/dl/xuetang.php');
Yii::app()->end();
}
}
$this->verifyLogin();
$url = $this->createUrl('/repositories/default/index'); //資源不存在時的跳轉鏈接
if(!$courseID){
$this->redirect_msgBox($url, array('msg' => '參數錯誤','time'=>1000));
}
//專題內容即對應微課內容
$contentArr = V2CourseService::factory()->getCourseWeikes($courseID,1); //2144550
$subjectDetails = $contentArr['content'];
if(!$subjectDetails || $subjectDetails->fdDisabled == 1){
$this->redirect_msgBox($url, array('msg' => '該內容已經被刪除','time'=>1000));
}
if($subjectDetails->users->id != $userID){
if($subjectDetails->mainContribute->fdStatus==0 || $subjectDetails->mainContribute->fdStatus==2){
$this->redirect_msgBox($url, array('msg'=>'該內容未審核或者審核不通過! ','time'=>1000));
}
}
//當前的微課內容
$weikeData = CourseUtils::selectWeike($contentArr, $weikeID) ;
$weike = $weikeData['weike'] ;
if(!$weike || $weike->fdDisabled == 1) {
$this->redirect_msgBox($url, array('msg' => '該內容已經被刪除','time'=>1000));
}
//當前內容(微課)的附件
$attachmentFiles = WeikeService::factory()->getAttachmentFiles($weike->id);
//播放次數+1
$this->_getContentService()->updateIntegerValue($weike->id, Yii::app()->params['VIDEO_PLAY_TOTAL']); //更新微課播放次數
//對應專題播放次數+1
$this->_getContentService()->updateIntegerValue($courseID,Yii::app()->params['VIDEO_PLAY_TOTAL']); //更新專題播放次數
//獲取知識點、章節信息
$Relevance = ExerciseService::factory()->getRelevance($courseID);
$knowleges = $Relevance['knows']; //知識點
$section['edtion'] = $Relevance['edtion'];//獲取章節信息
//獲取輔材信息
$section['auxiliary'] = V2WeikeService::factory()->getSection($courseID);
//標簽
$tagsInfo = '';
if($subjectDetails->tags && is_array($subjectDetails->tags)){
foreach ($subjectDetails->tags as $tag){
$tagsInfo .= $tag->fdValue.' ' ;
}
}
$tags = WeikeService::factory()->getTag($weike->id); //獲取視頻打點標簽 json格式
$ext = FileUtils::getExtension($weike->wkfile->fdURL);
$presrc = str_replace(".".$ext, ".jpg", $weike->wkfile->fdURL);
$weikeID or $weikeID = $weike->id; //第一次打開專題時,weikeID的值為空,默認取值
$weikeCollect = $this->_getContentService()->isFavorite($weikeID,Yii::app()->user->id) ? 1 : 0; //收藏專題下的微課
$subjectCollect = $this->_getContentService()->isFavorite($subjectDetails->id,$userID) ? 1 : 0; //收藏專題
//獲取本人評分
$userRank = CommentService::factory()->getUserRank($userID,$weikeID);
if($userRank) $rank=$userRank->fdRank/20;
//保存播放記錄到mango
//@link https://tower.im/projects/09c3ae86ed0e48fd94cfafa7a449be64/docs/c47e314633324988afa77bcc21be0df2/
$data = array(
'sourceKey' => Yii::app()->params["APPLICATION_MAP"][WK::WEB_TY_KETANG],
'cid' => $subjectDetails->id,
'ctype' => WK::COURSE_TYPE_ID,
'uid' => $userID ?: 0,
'time' => date('Y-m-d H:i:s',time()),
'type' => 1,
'excluded' => $subjectDetails->fdDisabled,
'client' => json_encode($this->_getClientInfo()),
);
$this->render('course/content', array(
'data' => $data,
'tags' => $tags,
'files' => $attachmentFiles,
'presrc' => $presrc ,
'weike' => $weike,
'course' => $subjectDetails,
'section' => $section,
'tagsInfo' => $tagsInfo,
'userRank' => $rank,
'contentArr' => $contentArr,
'knowleges' => $knowleges,
'weikeCollect' => $weikeCollect,
'subjectCollect' => $subjectCollect,
)) ;
}
```

- 說明
- 開發任務
- 星課-真光
- 課表
- Excel Down
- 調課
- 課表修改
- 課表代碼分析
- 課堂
- 課堂:應用商店通信管理協議
- 教師賬號強制綁定手機或郵箱
- 強制綁定手機和修改密碼的規則
- 學堂
- 課程學習:討論功能
- 后臺:課程討論管理
- 課程直播接口
- 學習統計功能(舊版)
- 學習統計功能(新版)
- 同步課程統計功能
- 同步課程編輯-新增視頻
- 第三方接口
- 學科網
- 安徽第三方
- 大賽
- 管控系統
- 日志管理
- 設備日志
- 平板接口
- 渝教
- 教學總結
- 空白目錄
- Yii 1.1
- 學堂架構
- Yii 1.1一些方法的解讀
- MVCS結構
- 基礎使用語法
- 創建1個新模塊
- 關聯模型
- CDbCriteria
- 學生-課堂記錄
- 學生端頁面展示
- 教師端頁面展示
- 編輯課程文檔
- SQL
- 課堂項目運行入口
- 上傳資源示意圖
- 行為
- PHPStorm
- 源碼閱讀
- 會診答卷頁面
- 考點練習
- 資源首頁
- 同步課程
- 同步課程:章節信息
- 升學復習
- 統計圖-范例
- 模塊
- 非法詞
- 服務層
- MongoDB類
- 學堂作答記錄從Mongo新集合獲取數據
- MongoYii
- 錯題集
- 小技巧
- 完善資料
- 郵件發送
- K12
- JSpang視頻課程
- MongoDB
- 創業
- 項目
- 包包