Files
mayi-grade/application/system/model/Category.php
T
2018-10-25 16:54:56 +08:00

26 lines
425 B
PHP

<?php
namespace app\system\model;
use app\common\model\Base;
class Category extends Base
{
// 获取类别列表
public function getCategory($id = 0)
{
return $this
->where('pid',$id)
->where('status',1)
->field('id,title')
->select();
}
// 父级类别获取器
public function getPidAttr($value)
{
return $this->where('id',$value)->value('title');
}
}