|
|
|
@ -322,6 +322,16 @@ class CourseController extends CommonController
|
|
|
|
if ($courseContentEvaluationForm) {
|
|
|
|
if ($courseContentEvaluationForm) {
|
|
|
|
return $this->fail([ResponseCode::ERROR_BUSINESS, '您已提交过评价']);
|
|
|
|
return $this->fail([ResponseCode::ERROR_BUSINESS, '您已提交过评价']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$courseContent = CourseContent::find($all['course_content_id']);
|
|
|
|
|
|
|
|
if ($courseContent->course_content_evaluation_status == 0) {
|
|
|
|
|
|
|
|
return $this->fail([ResponseCode::ERROR_BUSINESS, '问卷未发布']);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strtotime($courseContent->course_content_evaluation_start_time) > time()) {
|
|
|
|
|
|
|
|
return $this->fail([ResponseCode::ERROR_BUSINESS, '评价时间未开始']);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (strtotime($courseContent->course_content_evaluation_end_time) < time()) {
|
|
|
|
|
|
|
|
return $this->fail([ResponseCode::ERROR_BUSINESS, '评价时间已结束']);
|
|
|
|
|
|
|
|
}
|
|
|
|
$model = CourseContentEvaluationForm::create([
|
|
|
|
$model = CourseContentEvaluationForm::create([
|
|
|
|
'user_id' => $this->getUserId(),
|
|
|
|
'user_id' => $this->getUserId(),
|
|
|
|
'time_total' => $all['time_total'],
|
|
|
|
'time_total' => $all['time_total'],
|
|
|
|
|