|
|
|
|
@ -223,7 +223,7 @@ class CourseController extends CommonController
|
|
|
|
|
*/
|
|
|
|
|
public function myCourse()
|
|
|
|
|
{
|
|
|
|
|
$list = Course::with('typeDetail')->with(['courseSigns' => function ($query) {
|
|
|
|
|
$list = Course::with('typeDetail','courseContentEvaluation')->with(['courseSigns' => function ($query) {
|
|
|
|
|
$query->where('user_id', $this->getUserId());
|
|
|
|
|
}])->whereHas('courseSigns', function ($query) {
|
|
|
|
|
$query->where('user_id', $this->getUserId());
|
|
|
|
|
@ -318,12 +318,10 @@ class CourseController extends CommonController
|
|
|
|
|
$messages = [
|
|
|
|
|
'course_content_evaluation_id.required' => '问卷id必填',
|
|
|
|
|
'data.required' => '表单数据必填',
|
|
|
|
|
// 'time_total.required' => '用时必填'
|
|
|
|
|
];
|
|
|
|
|
$validator = Validator::make($all, [
|
|
|
|
|
'course_content_evaluation_id' => 'required',
|
|
|
|
|
'data' => 'required',
|
|
|
|
|
// 'time_total' => 'required'
|
|
|
|
|
], $messages);
|
|
|
|
|
if ($validator->fails()) {
|
|
|
|
|
return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]);
|
|
|
|
|
@ -345,6 +343,7 @@ class CourseController extends CommonController
|
|
|
|
|
return $this->fail([ResponseCode::ERROR_BUSINESS, '您已提交过评价']);
|
|
|
|
|
}
|
|
|
|
|
$model = CourseContentEvaluationForm::create([
|
|
|
|
|
'course_id' => $courseContentEvaluation->course_id,
|
|
|
|
|
'course_content_evaluation_id' => $all['course_content_evaluation_id'],
|
|
|
|
|
'user_id' => $this->getUserId(),
|
|
|
|
|
'time_total' => $all['time_total'] ?? 0,
|
|
|
|
|
|