public function del() { $id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : ''; if ($this->db->get_one(array('id' => $id))) { if ($this->db->delete(array('id' => $id))) { dbsource_cache(); showmessage(L('operation_success'), '?m=dbsource&c=dbsource_admin&a=init'); } else { showmessage(L('operation_failure'), '?m=dbsource&c=dbsource_admin&a=init'); } } else { showmessage(L('notfound'), '?m=dbsource&c=dbsource_admin&a=init'); } }
/** * 删除外部数据源 */ public function del() { $id = isset($_GET['id']) && intval($_GET['id']) ? intval($_GET['id']) : ''; if ($this->db->getby_id($id)) { if ($this->db->where(array('id' => $id))->delete()) { dbsource_cache(); showmessage(L('operation_success'), U('dbsource/dbsource_admin/init')); } else { showmessage(L('operation_failure'), U('dbsource/dbsource_admin/init')); } } else { showmessage(L('notfound'), U('dbsource/dbsource_admin/init')); } }