alias('a') ->field(" a.cate_code as value,a.cate_name as label,a.father_code as pid, (case (select count(id) from web_category where father_code = a.cate_code) when 0 then true else false end) as leaf ") ->where($where)->order("order_id asc")->select()->toArray(); return $menulist; } }