<?php

namespace DAO;



class StoreGoodsClassGoodsModel extends \DAO\AbstractModel {



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

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

    }
    public function getList($where,$field,$order = true){
        $this->setDb($this->dbName);
        if($order){
            return $this->db->select($field)->from($this->_tableName)->where($where)->order('gc_sort','ASC')->fetchAll();
        }
        return $this->db->select($field)->from($this->_tableName)->where($where)->fetchAll();
    }
    /**
     * 类实例
     *
     * @var \DAO\UserModel
     */
    private static $_instance = null;

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

        return self::$_instance;
    }

}
