<?php
namespace app\common\model;

use think\Model;

class MallCate extends Model
{
	// 设置字段信息
    protected $schema = [
        'id'			=> 'int',
		'title'			=> 'string',
        'status'		=> 'tinyint',
        'priority'		=> 'int'
    ];
	
	public function getStatusTextAttr($value,$data)
	{
		$status = [1=>'显示', 2=>'隐藏']; 
		return $status[$data['status']];
	}
	
	public function getIntegralTextAttr($value,$data)
	{
		return 0;
	}
	
	// 关联MallGoods
	public function mallGoods()
	{
	    return $this->hasMany(MallGoods::class, "cateid", "id");
	}


	
}