Files
sam-manage/app/Models/Interview/InterviewProject.php
김보곤 051707c1be fix: [database] codebridge 모델 cross-DB 관계 오류 수정
- samdb 공유 모델에 $connection = 'mysql' 명시적 선언
- codebridge 모델에서 eager-load 시 connection 상속 방지
- 영향 모델: User, Tenant, Department, Process, File(2), Approval, AiQuotationModule, InterviewProject
2026-03-09 23:35:13 +09:00

63 lines
1.4 KiB
PHP

<?php
namespace App\Models\Interview;
use App\Models\User;
use App\Traits\BelongsToTenant;
use App\Traits\ModelTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class InterviewProject extends Model
{
use BelongsToTenant, ModelTrait, SoftDeletes;
protected $connection = 'mysql';
protected $fillable = [
'tenant_id',
'company_name',
'company_type',
'contact_person',
'contact_info',
'status',
'target_tenant_id',
'product_categories',
'summary',
'progress_percent',
'created_by',
'updated_by',
'deleted_by',
];
protected $casts = [
'product_categories' => 'array',
'progress_percent' => 'integer',
];
public function categories()
{
return $this->hasMany(InterviewCategory::class, 'interview_project_id');
}
public function attachments()
{
return $this->hasMany(InterviewAttachment::class, 'interview_project_id');
}
public function knowledge()
{
return $this->hasMany(InterviewKnowledge::class, 'interview_project_id');
}
public function sessions()
{
return $this->hasMany(InterviewSession::class, 'interview_project_id');
}
public function creator()
{
return $this->belongsTo(User::class, 'created_by');
}
}