25 lines
581 B
PHP
25 lines
581 B
PHP
<?php
|
|
|
|
namespace Modules\Admin\app\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Criteria extends Model
|
|
{
|
|
protected $table = 'criterias';
|
|
protected $fillable = ['name', 'description', 'type'];
|
|
|
|
public function sprints()
|
|
{
|
|
return $this->belongsToMany(Sprint::class, 'sprints_criterias')
|
|
->withPivot('point', 'expect_result', 'actual_result', 'note');
|
|
}
|
|
|
|
public function users()
|
|
{
|
|
return $this->belongsToMany(User::class, 'users_criterias')
|
|
->withPivot('point', 'note', 'sprint_id')
|
|
;
|
|
}
|
|
}
|