first commit
This commit is contained in:
22
app/common/model/CompanyOperators.php
Normal file
22
app/common/model/CompanyOperators.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class CompanyOperators extends Model
|
||||
{
|
||||
protected $table = 'company_operators';
|
||||
|
||||
public function company()
|
||||
{
|
||||
return $this->belongsTo(Companys::class, 'company_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
public function getCompanyNameAttr($value, $data)
|
||||
{
|
||||
return $this->company->company_name ?? null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user