<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Gmenu extends Model
{
    protected $table = 'gmenu';
    protected $fillable =  ['id','parent_id','status','sort','gname','iconUrl','gaction','updated_at','isleaf'];

    public function  getByPid($pid=0){
        $data = $this->select('id','parent_id','gname','iconUrl','gaction','updated_at','isleaf')->where(['parent_id'=>$pid,'status'=>1])->orderby('sort','asc')->get()->toArray();
        return $data;
    }

}
