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.

35 lines
641 B

<?php
namespace App\Models;
class EmployeeParticipation extends CommonModel
{
protected $table = 'employee_participations';
protected $appends = ['type_text'];
public static $intToString = [
'type' => [
1 => '员工参与数',
2 => '干部培训数',
],
];
/**
* 获取类型文本
*/
public function getTypeTextAttribute()
{
return self::$intToString['type'][$this->type] ?? '';
}
/**
* 关联课程类型
*/
public function courseType()
{
return $this->hasOne(CourseType::class, 'id', 'course_type_id');
}
}