where('pid',$id) ->where('status',1) ->field('id,title') ->select(); } // 父级类别获取器 public function getPidAttr($value) { return $this->where('id',$value)->value('title'); } }