one($where); if ($info) { $id = $info['id']; } else { $where['url'] = $url; $id = Dever::db('short/info')->insert($where); } return Dever::idtostr($id); } public function show($str) { $id = Dever::strtoid($str); if ($id && $id > 0) { $info = Dever::db('short/info')->one($id); if ($info && $info['url']) { Dever::location($info['url']); } } return 'error'; } }