<?php
namespace DAO\Article;
/**
 * User: liuyuzhen
 * Date: 2018/8/7
 * Time: 16:01
 * Description:
 */
class ArticleClassModel extends \DAO\AbstractModel{



    public function init(){

    }

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

    /**
     * 主键
     *
     * @var string
     */
    protected $_primaryKey = 'ac_id';

    /**
     * 获取单条数据
     * @param $where
     * @return array
     */
    public function find($where,$field= \Our\NameConst::allField){
        $this->setDb($this->dbName);
        $data = $this->db->from($this->_tableName)->select($field)->where($where)->fetchOne();
        return $data;
    }


    /**
     * 类实例
     */
    private static $_instance = null;

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

        return self::$_instance;
    }
}