46 lines
1014 B
PHP
46 lines
1014 B
PHP
<?php
|
|
|
|
namespace App\Models\Tenants;
|
|
|
|
use App\Models\Members\User;
|
|
use App\Models\Commons\Department;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* @mixin IdeHelperTenantUserProfile
|
|
*/
|
|
class TenantUserProfile extends Model
|
|
{
|
|
protected $casts = [
|
|
'json_extra' => 'array',
|
|
];
|
|
|
|
protected $fillable = [
|
|
'tenant_id',
|
|
'user_id',
|
|
'department_id',
|
|
'position_key',
|
|
'job_title_key',
|
|
'work_location_key',
|
|
'employment_type_key',
|
|
'manager_user_id',
|
|
'json_extra',
|
|
'created_at',
|
|
'updated_at',
|
|
'profile_photo_path',
|
|
'display_name',
|
|
];
|
|
|
|
// 관계: users 테이블은 전역이라 App\Models\User 로 연결
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
|
|
// 조직, 직급 등은 옵션/코드 참조 가능 (필요시 추가)
|
|
public function department()
|
|
{
|
|
return $this->belongsTo(Department::class, 'department_id');
|
|
}
|
|
}
|