/** * 检测分类是否存在 * * @param string $name * @param int $pid * @param int $id * @return bool */ public function name_exists($name, $pid, $id = 0) { //require_once '..\Action\baseAction.class.php'; $base = new BaseAction(); $where = "name='" . $name . "' AND pid='" . $pid . "' AND id<>'" . $id . "' AND tokenTall='" . $base->getTokenTall() . "'"; $result = $this->where($where)->count('id'); if ($result) { return true; } else { return false; } }