34 lines
749 B
PHP
34 lines
749 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class perbandingans extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'perbandinganss';
|
|
protected $primaryKey = 'id';
|
|
|
|
protected $fillable = [
|
|
'subkriteria1',
|
|
'nilai_bobot',
|
|
'subkriteria2',
|
|
|
|
];
|
|
|
|
protected $with = ['datakriteria', 'datasubkriteria'];
|
|
|
|
public function datakriteria():BelongsTo{
|
|
return $this->belongsTo(datakriteria::class, 'id_kriteria');
|
|
}
|
|
public function datasubkriteria(): BelongsTo
|
|
{
|
|
return $this->belongsTo(DataSubkriteria::class, 'id_subkriteria');
|
|
}
|
|
|
|
}
|