Commit 534d8c54 authored by xiabin's avatar xiabin

修改预览页

parent 4f295e01
...@@ -179,7 +179,7 @@ class HomeController extends \yii\web\Controller ...@@ -179,7 +179,7 @@ class HomeController extends \yii\web\Controller
public function actionPreview($courseId) public function actionPreview($courseId)
{ {
$coursewareInfo = Courseware::findOne(['course_id' => $courseId, 'status' => Courseware::STATUS_OK]); $coursewareInfo = Courseware::findOne(['course_id' => $courseId]);
$course = Course::findOne(['id' => $courseId]); $course = Course::findOne(['id' => $courseId]);
if ($course === NULL or Yii::$app->user->id != $coursewareInfo->user_id) { if ($course === NULL or Yii::$app->user->id != $coursewareInfo->user_id) {
throw new HttpException(404, '页面不存在'); throw new HttpException(404, '页面不存在');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment