增加物料分类的功能部分代码
This commit is contained in:
46
app/admin/model/PdmParttype.php
Normal file
46
app/admin/model/PdmParttype.php
Normal 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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user