PDM更新数据结构后,基础数据查询和BOM初始查询等基本功能都已经OK,待完善和细化相关的上传和下载服务等。

This commit is contained in:
panx
2024-12-29 22:18:05 +08:00
parent d3d429e964
commit d70fcccc1d
99 changed files with 4877 additions and 948 deletions

View File

@@ -1,42 +0,0 @@
<?php
namespace app\common\model;
use think\Model;
use think\model\concern\SoftDelete;
/**
* pdm_mfg_name
* <!--partmanage-->
* 制造商名录
* Class PdmMfgName
* @package app\common\model
*/
class PdmMfgName extends Model
{
use SoftDelete;
// 定义时间戳字段名
protected $createTime = 'create_time';
protected $updateTime = 'update_time';
protected $deleteTime = 'delete_time';
/**
* 定义 sa_user 关联模型
* @localKey createrid
* @bind name,nickname
*/
public function user()
{
return $this->hasOne(\app\common\model\system\User::Class,'id','createrid')->bind(['name','nickname']);
}
public function usernames()
{
// return \app\common\model\system\User::select()->toArray();
return \app\common\model\system\Admin::select()->toArray();
}
}

View File

@@ -1,59 +0,0 @@
<?php
namespace app\common\model;
use think\Model;
use think\model\concern\SoftDelete;
/**
* pdm_purchasecode
* <!--partmanage-->
* 采购编码
* Class PdmPurchasecode
* @package app\common\model
*/
class PdmPurchasecode extends Model
{
use SoftDelete;
// 定义时间戳字段名
protected $createTime = 'create_time';
protected $updateTime = 'update_time';
protected $deleteTime = 'delete_time';
/**
* 定义 sa_user 关联模型
* @localKey user_id
* @bind nickname,name
*/
public function user()
{
return $this->hasOne(\app\common\model\system\User::Class,'id','user_id')->bind(['nickname','name']);
}
public function setAttributeAttr($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 getAttributeAttr($value)
{
if (!empty($value) && is_string($value)) {
$value = json_decode($value, true);
}
return $value;
}
}

View File

@@ -1,38 +0,0 @@
<?php
namespace app\common\model;
use think\Model;
use think\model\concern\SoftDelete;
/**
* pdm_symbol
* <!---->
* 原理符号
* Class PdmSymbol
* @package app\common\model
*/
class PdmSymbol extends Model
{
use SoftDelete;
// 定义时间戳字段名
protected $createTime = 'create_time';
protected $updateTime = 'update_time';
protected $deleteTime = 'delete_time';
/**
* 定义 sa_user 关联模型
* @localKey admin_id
* @bind nickname,name
*/
public function user()
{
return $this->hasOne(\app\common\model\system\User::Class,'id','admin_id')->bind(['nickname','name']);
}
}