function edit() { $id = intval(I("get.id")); $tree = new \PathTree(); $tree->icon = array(' │ ', ' ├─ ', ' └─ '); $tree->nbsp = '---'; $result = $this->terms_obj->where(array("term_id" => array("NEQ", $id), "path" => array("notlike", "%-{$id}-%")))->order(array("path" => "asc"))->select(); $tree->init($result); $tree = $tree->get_tree(); $data = $this->terms_obj->where(array("term_id" => $id))->find(); $this->assign("terms", $tree); $this->assign("data", $data); $this->display(); }
function move() { if (IS_POST) { if (isset($_GET['ids']) && isset($_POST['term_id'])) { $tids = $_GET['ids']; if ($this->terms_relationship->where("tid in ({$tids})")->save($_POST)) { $this->success("移动成功!"); } else { $this->error("移动失败!"); } } } else { $parentid = intval(I("get.parent")); $tree = new PathTree(); $tree->icon = array(' │ ', ' ├─ ', ' └─ '); $tree->nbsp = '---'; $result = $this->terms_obj->order(array("path" => "asc"))->select(); $tree->init($result); $tree = $tree->get_tree(); $this->assign("terms", $tree); $this->display(); } }
/** * @todo googs cate */ function sp_sql_cates($parentid = null) { $tree = new \PathTree(); $tree->icon = array(' │ ', ' ├─ ', ' └─ '); $tree->nbsp = '---'; $result = D("Common/Cate")->order(array("path" => "asc"))->select(); $tree->init($result); $tree = $tree->get_tree(); return $tree; }