74 lines
1.8 KiB
PHP
74 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace app\admin\model;
|
|
|
|
use think\Model;
|
|
use think\model\concern\SoftDelete;
|
|
|
|
/**
|
|
* pdm_partitem_relation
|
|
* <!--partmanage-->
|
|
* PN关系维护
|
|
* Class PdmPartitemRelation
|
|
* @package app\admin\model
|
|
*/
|
|
class PdmPartitemRelation extends Model
|
|
{
|
|
|
|
use SoftDelete;
|
|
|
|
// 定义时间戳字段名
|
|
protected $createTime = 'create_time';
|
|
protected $updateTime = 'update_time';
|
|
protected $deleteTime = 'delete_time';
|
|
|
|
|
|
/**
|
|
* 定义 sa_admin 关联模型
|
|
* @localKey creatorid
|
|
* @bind name,nickname
|
|
*/
|
|
public function admin()
|
|
{
|
|
return $this->hasOne(\app\common\model\system\Admin::Class,'id','creatorid')->bind(['name','nickname']);
|
|
}
|
|
/**
|
|
* 定义 sa_pdm_partitem_index 关联模型
|
|
* @localKey partnumber
|
|
* @bind description,value,purchasecode
|
|
*/
|
|
public function pdmPartitemIndex()
|
|
{
|
|
return $this->hasOne(\app\admin\model\PdmPartitemIndex::Class,'partnumber','partnumber')->bind(['description','value','purchasecode']);
|
|
}
|
|
/**
|
|
* 定义 sa_pdm_symbol 关联模型
|
|
* @localKey symbolid
|
|
* @bind symbolname,view,attachment
|
|
*/
|
|
public function pdmSymbol()
|
|
{
|
|
return $this->hasOne(\app\admin\model\PdmSymbol::Class,'id','symbolid')->bind(['symbolname','view','attachment']);
|
|
}
|
|
/**
|
|
* 定义 sa_pdm_footprint 关联模型
|
|
* @localKey footprintid
|
|
* @bind footprint,manufacture,view,attachment
|
|
*/
|
|
public function pdmFootprint()
|
|
{
|
|
return $this->hasOne(\app\admin\model\PdmFootprint::Class,'id','footprintid')->bind(['footprint','manufacture','view','attachment']);
|
|
}
|
|
/**
|
|
* 定义 sa_department 关联模型
|
|
* @localKey departmentid
|
|
* @bind title
|
|
*/
|
|
public function department()
|
|
{
|
|
return $this->hasOne(\app\common\model\system\Department::Class,'id','departmentid')->bind(['title']);
|
|
}
|
|
|
|
|
|
|
|
} |