28 lines
570 B
PHP
28 lines
570 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\BaseModel;
|
|
|
|
class AttendanceCommentTemplate extends BaseModel
|
|
{
|
|
protected $table = 'attendance_comment_template';
|
|
protected $primaryKey = 'id';
|
|
public $timestamps = true;
|
|
protected $fillable = [
|
|
'min_score',
|
|
'max_score',
|
|
'template_text',
|
|
'is_active',
|
|
'created_at',
|
|
'updated_at',
|
|
];
|
|
|
|
public function getActiveTemplates(): array
|
|
{
|
|
return $this->where('is_active', 1)
|
|
->orderBy('min_score', 'DESC')
|
|
->findAll();
|
|
}
|
|
}
|