更新数据关联查询,以及基本的数据的编辑,部分有待进一步完善。
This commit is contained in:
@@ -39,7 +39,7 @@ class PdmPartitemIndex extends Model
|
||||
* @localKey parttypeid
|
||||
* @bind name
|
||||
*/
|
||||
public function parttype()
|
||||
public function pdmParttype()
|
||||
{
|
||||
return $this->hasOne(\app\admin\model\PdmParttype::Class,'id','parttypeid')->bind(['name']);
|
||||
}
|
||||
@@ -49,11 +49,21 @@ class PdmPartitemIndex extends Model
|
||||
* @localKey parttypeid
|
||||
* @bind name
|
||||
*/
|
||||
public function mfgname()
|
||||
public function pdmMfgName()
|
||||
{
|
||||
return $this->hasOne(\app\admin\model\PdmMfgName::Class,'id','mfg_id')->bind(['mfgname']);
|
||||
}
|
||||
|
||||
/**
|
||||
* 定义 sa_admin 关联模型
|
||||
* @localKey parttypeid
|
||||
* @bind name
|
||||
*/
|
||||
public function pdmPurchasecode()
|
||||
{
|
||||
return $this->hasOne(\app\admin\model\PdmPurchasecode::Class,'purchasecode','purchasecode')->bind(['mpn']);
|
||||
}
|
||||
|
||||
public function setPartattributeAttr($value)
|
||||
{
|
||||
if (!empty($value) && is_array($value)) {
|
||||
|
||||
@@ -32,6 +32,42 @@ class PdmPartitemRelation extends Model
|
||||
{
|
||||
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']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user