update model jenispenilaian, penilaian dan teamsusers
This commit is contained in:
parent
479860d12d
commit
a51d5fbeff
@ -18,5 +18,8 @@ class JenisPenilaian extends Model
|
||||
'created_at', 'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by'
|
||||
];
|
||||
|
||||
public function penilaian(){
|
||||
return $this->hasMany(Penilaian::class , 'jenis_penilaian_id', 'id');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,21 +17,21 @@ class Penilaian extends Model
|
||||
*/
|
||||
protected $table = 'penilaian';
|
||||
protected $fillable = [
|
||||
'jenis_penilaian_id', 'team_id', 'user_id', 'tanggal_kunjungan', 'keterangan',
|
||||
'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_at',
|
||||
'jenis_penilaian_id', 'team_id', 'user_id', 'tanggal_kunjungan', 'keterangan',
|
||||
'status', 'authorized_status', 'authorized_at', 'authorized_by', 'created_at',
|
||||
'created_by', 'updated_at', 'updated_by', 'deleted_at', 'deleted_by'
|
||||
];
|
||||
|
||||
public function jenis_penilaian(){
|
||||
return $this->hasMany(JenisPenilaian::class);
|
||||
return $this->belongsTo(JenisPenilaian::class, 'jenis_penilaian_id', 'id');
|
||||
}
|
||||
|
||||
public function teams(){
|
||||
return $this->hasMany(Teams::class);
|
||||
return $this->belongsTo(Teams::class, 'team_id', 'id');
|
||||
}
|
||||
|
||||
public function users(){
|
||||
return $this->hasMany(User::class);
|
||||
return $this->belongsTo(User::class, 'user_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,18 +15,18 @@ class TeamsUsers extends Model
|
||||
*/
|
||||
protected $table = 'teams_users';
|
||||
protected $fillable = [
|
||||
'team_id', 'user_id', 'status', 'authorized_status', 'authorized_at',
|
||||
'authorized_by', 'created_at', 'created_by', 'updated_at', 'updated_by',
|
||||
'team_id', 'user_id', 'status', 'authorized_status', 'authorized_at',
|
||||
'authorized_by', 'created_at', 'created_by', 'updated_at', 'updated_by',
|
||||
'deleted_at', 'deleted_by'
|
||||
];
|
||||
|
||||
public function team()
|
||||
{
|
||||
return $this->belongsTo(Teams::class, 'team_id');
|
||||
return $this->belongsTo(Teams::class, 'team_id', 'id');
|
||||
}
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
return $this->belongsTo(User::class, 'user_id', 'id');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user