hasOne(Admin::class, 'id', 'create_user_id')->bind(['admin_name'=>'name']); } public function companyType() { return $this->hasOne(DictData::class, 'id', 'company_type')->bind(['dict_company_type'=>'id', 'company_type_name'=>'name']); } public function template() { return $this->hasOne(TaskTemplate::class, 'id', 'template_id')->bind(['template_name'=>'title']); } public function company() { return $this->hasOne(Company::class, 'id', 'company_id')->bind(['company_name']); } public function companyInfo() { return $this->hasOne(Company::class, 'id', 'company_id')->field('id,day_count,user_id'); } }