master
cody 5 months ago
parent 3a6820bd99
commit a7df31b00f

@ -322,6 +322,16 @@ class CourseController extends CommonController
if ($courseContentEvaluationForm) {
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([
'user_id' => $this->getUserId(),
'time_total' => $all['time_total'],

Loading…
Cancel
Save