/** * 更新数据表数据 */ private function _updateData($data) { if (XUtils::method() == 'POST') { if (!empty($_FILES['site_logo']['name'])) { $this->_getLogo('site_logo', SITE_PATH . 'static/', $data['site_logo']); } else { unset($data['site_logo']); } foreach ((array) $data as $key => $row) { $row = XUtils::addslashes($row); Yii::app()->db->createCommand("REPLACE INTO {{config}}(`variable`, `value`) VALUES('{$key}', '{$row}') ")->execute(); } XXcache::refresh('_config', 3600); parent::_backendLogger(array('catalog' => 'update', 'intro' => '更新系统配置,模块:' . $this->action->id)); XUtils::message('success', '更新完成', $this->createUrl($this->action->id)); } }