<?php

/**
 * Created by PhpStorm.
 * User: joe
 * Date: 17-1-24
 * Time: 上午11:12
 */
class Room_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('room',['id'=>$id])->row_array();
        }

        return $this->db->get('room')->result_array();
    }
}