增加物料分类的功能部分代码

This commit is contained in:
panx
2024-08-17 16:39:10 +08:00
parent 9bd8d44c1d
commit c26870b8c5
9 changed files with 591 additions and 3 deletions

View File

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