90 lines
2.2 KiB
PHP
90 lines
2.2 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace app\admin\model;
|
||
|
|
|
||
|
|
use think\Model;
|
||
|
|
use think\model\concern\SoftDelete;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* pdm_partitem_index
|
||
|
|
* <!--partmanage-->
|
||
|
|
* Partnumber管理
|
||
|
|
* Class PdmPartitemIndex
|
||
|
|
* @package app\admin\model
|
||
|
|
*/
|
||
|
|
class PdmPartitem extends Model
|
||
|
|
{
|
||
|
|
|
||
|
|
// use SoftDelete;
|
||
|
|
|
||
|
|
// 定义时间戳字段名
|
||
|
|
protected $createTime = 'create_time';
|
||
|
|
protected $updateTime = 'update_time';
|
||
|
|
protected $deleteTime = 'delete_time';
|
||
|
|
|
||
|
|
|
||
|
|
// /**
|
||
|
|
// * 定义 sa_admin 关联模型
|
||
|
|
// * @localKey creatorid
|
||
|
|
// * @bind nickname,name
|
||
|
|
// */
|
||
|
|
// public function admin()
|
||
|
|
// {
|
||
|
|
// return $this->hasOne(\app\common\model\system\Admin::Class,'id','creatorid')->bind(['nickname','name']);
|
||
|
|
// }
|
||
|
|
|
||
|
|
|
||
|
|
// /**
|
||
|
|
// * 定义 sa_admin 关联模型
|
||
|
|
// * @localKey parttypeid
|
||
|
|
// * @bind name
|
||
|
|
// */
|
||
|
|
// public function pdmParttype()
|
||
|
|
// {
|
||
|
|
// return $this->hasOne(\app\admin\model\PdmParttype::Class,'id','parttypeid')->bind(['name']);
|
||
|
|
// }
|
||
|
|
|
||
|
|
// /**
|
||
|
|
// * 定义 sa_admin 关联模型
|
||
|
|
// * @localKey parttypeid
|
||
|
|
// * @bind name
|
||
|
|
// */
|
||
|
|
// 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)) {
|
||
|
|
// $arr = [];
|
||
|
|
// foreach ($value['key'] as $key => $elem) {
|
||
|
|
// $arr[$elem] = $value['value'][$key];
|
||
|
|
// }
|
||
|
|
|
||
|
|
// $value = json_encode($arr,JSON_UNESCAPED_UNICODE);
|
||
|
|
// }
|
||
|
|
|
||
|
|
// return $value ?: json_encode([]);
|
||
|
|
// }
|
||
|
|
|
||
|
|
// public function getPartattributeAttr($value)
|
||
|
|
// {
|
||
|
|
// if (!empty($value) && is_string($value)) {
|
||
|
|
// $value = json_decode($value, true);
|
||
|
|
// }
|
||
|
|
|
||
|
|
// return $value;
|
||
|
|
// }
|
||
|
|
|
||
|
|
}
|