<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
 * zsb
 *
 * 租售宝系统基本类库
 *
 * @package         zsb
 * @author          EllisLab Dev Team
 * @copyright      Copyright (c) 2006 - 2014, HOUSE365, Inc.
 * @link            http://nj.sell.house.com
 * @since           Version 1.0
 * @filesource
 */

// ------------------------------------------------------------------------

/**
 * 租售宝系统模型层测试类文件
 *
 * 测试类文件功能描述
 *
 * @package         zsb
 * @subpackage      Models
 * @category        Models
 * @author          xz
 * @link
 */
class Test_model extends MY_Model 
{   
    /**
    * 用户uid
    *
    * @access private
    * @var integer
    */
    private $_uid = 0;
    
    
    /**
    * Constructor
    */
    public function __construct() 
    {
        parent::__construct(0,1,0);
    }
    
    
    /**
    * set_uid
    *
    * 初始化uid参数
    *
    * @access	public
    * @param	int $uid 用户编号
    * @return	void
    */
    public function set_uid( $uid )
    {
        $this->_uid = intval( $uid );
    }


    /**
    * get_uid
    *
    * 初始化uid参数
    *
    * @access	public
    * @return	int $uid 用户编号
    */
    public function get_uid( )
    {
        return $this->_uid ;
    }
    
    
    /**
    * get_houselist_by_uid
    *
    * 根据经纪人编号获取房源列表
    *
    * @access	public
    * @param	int     $esta 房源状态
    * @param	int     $limit 查询个数
    * @param	string  $order 排序
    * @return	array   房源列表数组
    */
    public function get_houselist_by_uid( $esta = 1 , $limit = 5 , $order = 'desc' )
    {   
        //查询条件
        $where_cond  = "uid = '".$this->_uid."' AND esta = '".$esta."' ";
        
        //查询字段
        $this->dbback->select("id , uid , address , district , streetid");
        //查询条件
        $this->dbback->where( $where_cond );
        //排序条件
        $this->dbback->order_by( 'updatetime' , $order );
        //查询
        $arr_data = $this->dbback->get( 'sell' , $limit )->result_array();

        return $arr_data;
    }
}

/* End of file Test_model.php */
/* Location: ./zsb/model/Test_model.php */
