save([ 'name' => $name, 'level' => $level, 'org_id' => $org_id ])){ return true; } } /** * dispool 关闭节点。 * * @params * $id integer 要关闭的组织结构节点 */ public static function dispool($id) { if( Pool::where('id',$id)->update([ 'status' => 0 ])){ return true; }else{ return false; } } public static function struc() { $where = []; /// $where[] = ['state','=',1]; $allpools = Pool::where($where)->order('level','asc')->select()->toArray(); return json_encode($allpools); } }