<?php

namespace DAO;


class GoodsPriceRangeModel extends \DAO\AbstractModel {



    /**
     * 表名
     *
     * @var string
     */
    protected $_tableName = 'han_goods_price_range';

    /**
     * 主键
     *
     * @var string
     */
    protected $_primaryKey = 'goods_commonid';
    public function init(){

    }

    public function getListByCommonId($goodsCommonId,$field){
        $this->setDb();
        return $this->db->select($field)->from($this->_tableName)->where(array('goods_commonid'=>$goodsCommonId))->order('num','DESC')->fetchAll();
    }

    /**
     * 类实例
     *
     * @var \DAO\UserModel
     */
    private static $_instance = null;

    /**
     * 获取类实例
     *
     * @return \DAO\UserModel
     */
    public static function getInstance() {
        if (!(self::$_instance instanceof self)) {
            self::$_instance = new self();
        }

        return self::$_instance;
    }

}
