data['info'] = $this->page(); return $this->data; } # 获取单页详情 public function page() { $type = Dever::input('type', 1); if (!$type) { Dever::alert('您访问的页面有误'); } $key = Dever::input('key'); if (!$key) { Dever::alert('您访问的页面有误'); } $name = Dever::input('name'); $where['type'] = $type; $where['key'] = $key; $info = Dever::db('main/page')->find($where); if (!$info) { $insert = $where; $insert['name'] = $name; $insert['content'] = $name; $id = Dever::db('main/page')->insert($insert); $info = Dever::db('main/page')->find($id); } return $info; } }