update assigment lintas region
This commit is contained in:
@@ -17,7 +17,7 @@ class Penilaian extends Model
|
||||
*/
|
||||
protected $table = 'penilaian';
|
||||
protected $fillable = [
|
||||
'jenis_penilaian_id', 'teams_id', 'tanggal_kunjungan', 'keterangan','nomor_registrasi','penilaian_id','surveyor_id','penilai_surveyor_id',
|
||||
'jenis_penilaian_id', 'tanggal_kunjungan', 'keterangan','nomor_registrasi',
|
||||
'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_at',
|
||||
'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by'
|
||||
];
|
||||
@@ -39,18 +39,9 @@ class Penilaian extends Model
|
||||
|
||||
public function userPenilai()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'penilaian_id', 'id');
|
||||
return $this->hasMany(PenilaianTeam::class, 'penilaian_id', 'id');
|
||||
}
|
||||
|
||||
public function userSurveyor()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'surveyor_id', 'id');
|
||||
}
|
||||
|
||||
public function userPenilaiSurveyor()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'penilai_surveyor_id', 'id');
|
||||
}
|
||||
|
||||
public function permohonan()
|
||||
{
|
||||
|
||||
39
app/Models/PenilaianTeam.php
Normal file
39
app/Models/PenilaianTeam.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Lpj\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Lpj\Database\Factories\PenilaianTeamFactory;
|
||||
|
||||
class PenilaianTeam extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'penilaian_team';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = ['penilaian_id', 'team_id', 'user_id','role'];
|
||||
|
||||
|
||||
public function userPenilaiTeam()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id', 'id');
|
||||
}
|
||||
|
||||
public function team(){
|
||||
|
||||
return $this->belongsTo(Team::class, 'team_id', 'id');
|
||||
}
|
||||
|
||||
public function penilaian(){
|
||||
|
||||
return $this->belongsTo(Penilaian::class, 'penilaian_id', 'id');
|
||||
}
|
||||
|
||||
protected static function newFactory(): PenilaianTeamFactory
|
||||
{
|
||||
//return PenilaianTeamFactory::new();
|
||||
}
|
||||
}
|
||||
@@ -83,4 +83,9 @@ class Permohonan extends Base
|
||||
{
|
||||
return $this->belongsTo(Penilaian::class, 'nomor_registrasi', 'nomor_registrasi');
|
||||
}
|
||||
|
||||
public function region()
|
||||
{
|
||||
return $this->belongsTo(Regions::class, 'region_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@ class Teams extends Model
|
||||
return $this->hasMany(TeamsUsers::class, 'teams_id', 'id');
|
||||
}
|
||||
|
||||
public function penilaian(){
|
||||
return $this->hasMany(Penilaian::class, 'teams_id', 'id');
|
||||
public function penilaianTeam(){
|
||||
return $this->hasMany(penilaianTeam::class, 'team_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user