feature/senior-officer #2

Merged
putrakuningan merged 6 commits from feature/senior-officer into staging 2024-09-11 02:12:50 +00:00
3 changed files with 12 additions and 9 deletions
Showing only changes of commit a51d5fbeff - Show all commits

View File

@ -18,5 +18,8 @@ class JenisPenilaian extends Model
'created_at', 'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by' 'created_at', 'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by'
]; ];
public function penilaian(){
return $this->hasMany(Penilaian::class , 'jenis_penilaian_id', 'id');
}
} }

View File

@ -17,21 +17,21 @@ class Penilaian extends Model
*/ */
protected $table = 'penilaian'; protected $table = 'penilaian';
protected $fillable = [ protected $fillable = [
'jenis_penilaian_id', 'team_id', 'user_id', 'tanggal_kunjungan', 'keterangan', 'jenis_penilaian_id', 'team_id', 'user_id', 'tanggal_kunjungan', 'keterangan',
'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_at', 'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_at',
'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by' 'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by'
]; ];
public function jenis_penilaian(){ public function jenis_penilaian(){
return $this->hasMany(JenisPenilaian::class); return $this->belongsTo(JenisPenilaian::class, 'jenis_penilaian_id', 'id');
} }
public function teams(){ public function teams(){
return $this->hasMany(Teams::class); return $this->belongsTo(Teams::class, 'team_id', 'id');
} }
public function users(){ public function users(){
return $this->hasMany(User::class); return $this->belongsTo(User::class, 'user_id', 'id');
} }

View File

@ -15,18 +15,18 @@ class TeamsUsers extends Model
*/ */
protected $table = 'teams_users'; protected $table = 'teams_users';
protected $fillable = [ protected $fillable = [
'team_id', 'user_id', 'status', 'authorized_status', 'authorized_at', 'team_id', 'user_id', 'status', 'authorized_status', 'authorized_at',
'authorized_by', 'created_at', 'created_by', 'updated_at', 'updated_by', 'authorized_by', 'created_at', 'created_by', 'updated_at', 'updated_by',
'deleted_at', 'deleted_by' 'deleted_at', 'deleted_by'
]; ];
public function team() public function team()
{ {
return $this->belongsTo(Teams::class, 'team_id'); return $this->belongsTo(Teams::class, 'team_id', 'id');
} }
public function user() public function user()
{ {
return $this->belongsTo(User::class, 'user_id'); return $this->belongsTo(User::class, 'user_id', 'id');
} }
} }