<?php
/**
	by it308.com
*/
class Setting_m extends CI_Model{
	public function __construct(){
		parent::__construct();
	}
	public function get(){
		$setting = $this->db->get('setting')->result_array();
		//将配置文件合并到一个数组
		$tmp = array();
		foreach ($setting as $key => $value) {
			$tmp[$value['name']]=$value['value'];
		}
		return $tmp;
	}
	public function set($data,$where){
		$this->db->where('name',$where);
		$this->db->update('setting',$data);
		return $this->db->affected_rows();
	}
}