<?php

/**
 * 前台 酒店地图 hotel_map 模块 Model
 * ============================================================================
 * ZhunaCMS 住哪网酒店分销联盟程序php版　BY Tmac PHP MVC framework
 * $Author: zhangwentao $  <zwttmac@qq.com>
 * $Id: hotel_map.class.php 50 2011-12-05 02:56:32Z zhangwentao $
 * http://un.zhuna.cn；
 */
class hotel_map extends Model
{

    private $db;
    private $hotel_table;

    /**
     * 初始化变量　定义私有变量
     */
    public function _init()
    {
        //连接数据库
        $this->db = $this->connect();
        $this->hotel_table = DB_PREFIX . 'hotel';
    }

    /**
     * 取酒店坐标信息
     * @param <type> $hotels
     */
    public function getitems_map($hotels)
    {
        $sql = "SELECT hotel_id, HotelName, Address, picture, MapPoint, Min_price FROM $this->hotel_table ";
        $sql .= "WHERE hotel_id in($hotels) ";
        $sql .= "ORDER BY instr('{$hotels}',`hotel_id`)";
        $rs = $this->db->getAll($sql);
        return $rs;
    }

}