find($id); } /** * 获取二级分类数组 * id为键,path为值 * @return array */ public static function getArray($where = [],$options = []) { $model = self::whereNull('deleted_at'); if(count($where) > 0){ $model->where($where); } $list = $model->pluck('id','path')->toArray(); if(!empty($options)){ $new = array_merge($options,$list); return array_flip($new); }else{ return array_flip($list); } } }