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.

52 lines
1.2 KiB

2 weeks ago
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class TeacherFollowRecord extends Model
{
protected $fillable = [
'teacher_id',
'admin_user_id',
'subject',
'content',
'follow_method_dict_item_id',
'urgency_dict_item_id',
'next_follow_subject',
'next_follow_date',
'followed_at',
'result',
];
protected $casts = [
'teacher_id' => 'integer',
'admin_user_id' => 'integer',
'follow_method_dict_item_id' => 'integer',
'urgency_dict_item_id' => 'integer',
'next_follow_date' => 'date',
'followed_at' => 'date',
];
public function teacher(): BelongsTo
{
return $this->belongsTo(Teacher::class);
}
public function adminUser(): BelongsTo
{
return $this->belongsTo(AdminUser::class, 'admin_user_id');
}
public function followMethodItem(): BelongsTo
{
return $this->belongsTo(DictItem::class, 'follow_method_dict_item_id');
}
public function urgencyItem(): BelongsTo
{
return $this->belongsTo(DictItem::class, 'urgency_dict_item_id');
}
}