<?php

/**
 * Created by PhpStorm.
 * User: joe
 * Date: 17-1-20
 * Time: 上午9:43
 */
class City_model extends CI_Model {

    public function __construct() {
        $this->load->database();
    }

    public function get($id=null,$select=null,$where=null) {
        if ($select) $this->db->select($select);
        if ($where) $this->db->where($where);
        if ($id) {
            return $this->db->get_where('city',['id'=>$id])->row_array();
        }
        return $this->db->get('city')->result_array();
    }

}