You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wx.sstbc.com/app/Models/CourseContentEvaluation.php

34 lines
862 B

5 months ago
<?php
namespace App\Models;
class CourseContentEvaluation extends SoftDeletesModel
{
4 months ago
protected $appends = ['course_content'];
5 months ago
4 months ago
public function getCourseContentAttribute()
5 months ago
{
4 months ago
if (empty($this->course_content_id)) {
return [];
}
$course_content_id = explode(',', $this->course_content_id);
return CourseContent::whereIn('id', $course_content_id)->get();
5 months ago
}
4 months ago
public function course()
5 months ago
{
4 months ago
return $this->belongsTo(Course::class, 'course_id', 'id');
5 months ago
}
5 months ago
public function courseContentEvaluationAsks()
{
return $this->hasMany(CourseContentEvaluationAsk::class, 'course_content_evaluation_id', 'id');
}
5 months ago
4 months ago
public function courseContentEvaluationForms()
{
5 months ago
return $this->hasMany(CourseContentEvaluationForm::class, 'course_content_evaluation_id', 'id');
}
5 months ago
}