<?php

namespace app\model\project;

use app\model\system\SystemUploadFile;
use think\Model;

class Business extends Model
{
    protected $name = 'business';

    protected $autoWriteTimestamp = true;

    protected $createTime = 'create_time';

    // 营业执照文件关联
    public function businessQualification()
    {
        return $this->hasOne(SystemUploadFile::class, 'fileid', 'business_qualification_url_id')
            ->field('fileid,filename,filesize,fileurl,filetype');
    }

    //行业
    public function businessIndustry()
    {
        return $this->hasOne(SystemUploadFile::class, 'fileid', 'business_industry_url_id')
            ->field('fileid,filename,filesize,fileurl,filetype');
    }

    //项目
    public function businessPorject()
    {
        return $this->hasOne(SystemUploadFile::class, 'fileid', 'business_project_url_id')
            ->field('fileid,filename,filesize,fileurl,filetype');
    }

    //补充材料
    public function businessMore()
    {
        return $this->hasOne(SystemUploadFile::class, 'fileid', 'more_url_id')
            ->field('fileid,filename,filesize,fileurl,filetype');
    }

    //企业logo
    public function businessLogo()
    {
        return $this->hasOne(SystemUploadFile::class, 'fileid', 'business_logo_url_id')
            ->field('fileid,filename,filesize,fileurl,filetype');
    }
}