$v){ $list_setting[$v['name']] = $v['value']; } } return $list_setting; } /** * 更新信息 * * @param array $param 更新数据 * @return bool 布尔类型的返回结果 */ public function updateSetting($param){ if (empty($param)){ return false; } if (is_array($param)){ foreach ($param as $k => $v){ $tmp = array(); $specialkeys_arr = array('statistics_code'); $tmp['value'] = (in_array($k,$specialkeys_arr) ? htmlentities($v,ENT_QUOTES) : $v); $where = " name = '". $k ."'"; $result = Db::update('setting',$tmp,$where); if ($result !== true){ return $result; } } dkcache('setting'); // @unlink(BASE_DATA_PATH.DS.'cache'.DS.'setting.php'); return true; }else { return false; } } }