编写类别

This commit is contained in:
巴掌 committed 2018-10-25 16:54:56 +08:00
1 parent 50c911f98a
commit 7b3d8cee54
25 files changed
+603 -98

No files matched your search

+18 -3
View File
@@ -2,9 +2,24 @@
namespace app\system\model;
use think\Model;
use app\common\model\Base;
class Category extends Model
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');
}
}