<?php
namespace app\admin\model;
use app\common\model\Base;
class AuthRule extends Base
{
public function getRule($pid = 0)
{
return $this
->where('pid',$pid)
->where('status',1)
->field('id,title')
->order(['paixu'])
->select();
}
public function getIsmenuAttr($value)
{
$arr = array('0'=>'否','1'=>'是');
return $arr[$value];
}
public function getPidAttr($value)
{
return $this->where('id',$value)->value('title');
}
public function getMymenuAttr($value)
{
return $this
->where('pid',$this->getAttr('id'))
->where('status&ismenu',1)
->field('title,url,name')
->order(['paixu'])
->select();
}
}