- config/database.php에 codebridge connection 추가 - 78개 MNG 전용 모델에 $connection = 'codebridge' 설정 - Admin (15): PM, 로드맵, API Explorer - Sales (16): 영업파트너, 수수료, 가망고객 - Finance (9): 법인카드, 자금관리, 홈택스 - Barobill (12): 은행/카드 동기화 관리 - Interview (1), ESign (6), Equipment (2) - AI (3), Audit (3), 기타 (11)
49 lines
979 B
PHP
49 lines
979 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* 사업자등록증 OCR 데이터 모델
|
|
*/
|
|
class BizCert extends Model
|
|
{
|
|
protected $connection = 'codebridge';
|
|
protected $table = 'biz_cert';
|
|
|
|
protected $fillable = [
|
|
'biz_no',
|
|
'company_name',
|
|
'representative',
|
|
'open_date',
|
|
'address',
|
|
'biz_type',
|
|
'biz_item',
|
|
'issue_date',
|
|
'raw_text',
|
|
'ocr_method',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'open_date' => 'date',
|
|
'issue_date' => 'date',
|
|
];
|
|
}
|
|
|
|
/**
|
|
* 사업자번호 포맷팅 (XXX-XX-XXXXX)
|
|
*/
|
|
public function getFormattedBizNoAttribute(): string
|
|
{
|
|
$no = preg_replace('/[^0-9]/', '', $this->biz_no);
|
|
if (strlen($no) === 10) {
|
|
return substr($no, 0, 3).'-'.substr($no, 3, 2).'-'.substr($no, 5, 5);
|
|
}
|
|
|
|
return $this->biz_no;
|
|
}
|
|
}
|