51 lines
1.2 KiB
PHP
51 lines
1.2 KiB
PHP
<?php
|
|
declare (strict_types = 1);
|
|
|
|
namespace app\admin\model\v1;
|
|
|
|
use think\Model;
|
|
use think\model\concern\SoftDelete;
|
|
|
|
/**
|
|
* @mixin \think\Model
|
|
*/
|
|
class ArticleCategoryModel extends Model
|
|
{
|
|
// 启动软删除
|
|
use SoftDelete;
|
|
// 软删除标记数据字段
|
|
protected $deleteTime = 'deleted_at';
|
|
|
|
// 表名
|
|
protected $name = 'article_category';
|
|
|
|
// 主键
|
|
protected $pk = 'id';
|
|
|
|
// 字段信息
|
|
protected $schema = [
|
|
'id' => 'int',
|
|
'language_id' => 'int',
|
|
'pid' => 'int',
|
|
'name' => 'string',
|
|
'short_name' => 'string',
|
|
'icon' => 'string',
|
|
'desc' => 'string',
|
|
'sort' => 'int',
|
|
'level' => 'int',
|
|
'is_show' => 'int',
|
|
'seo_title' => 'string',
|
|
'seo_keywords' => 'string',
|
|
'seo_desc' => 'string',
|
|
'created_at' => 'datetime',
|
|
'updated_at' => 'datetime',
|
|
'deleted_at' => 'datetime',
|
|
];
|
|
|
|
// 搜索分类名
|
|
public function searchNameAttr($query, $value, $data)
|
|
{
|
|
$query->where('name', 'like', '%' . $value . '%');
|
|
}
|
|
}
|