'营业执照', 'legal_id_card' => '法人身份证(正反面)', 'bank_account_proof' => '开户许可证 / 银行账户证明', 'operating_permit' => '快递经营许可证', 'quote_sheet' => '盖章报价单', 'other' => '其他资料', ]; /** 提交审核前必须上传的资料。 */ public const REQUIRED_KINDS = ['business_license', 'bank_account_proof', 'quote_sheet']; protected $table = 'business_courier_onboarding_files'; protected $fillable = ['company_id', 'onboarding_id', 'kind', 'original_name', 'path', 'mime', 'size']; protected $casts = [ 'company_id' => 'integer', 'onboarding_id' => 'integer', 'size' => 'integer', 'deleted_at' => 'datetime', ]; public function kindLabel(): string { return self::KINDS[$this->kind] ?? $this->kind; } public function isImage(): bool { return str_starts_with((string) $this->mime, 'image/'); } public function sizeLabel(): string { $size = (int) $this->size; return $size >= 1048576 ? sprintf('%.1f MB', $size / 1048576) : sprintf('%d KB', max(1, (int) ceil($size / 1024))); } }