<?php

namespace DAO;

class StoreCouponGoodsModel extends \DAO\AbstractModel {



    protected function init(){

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

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




    public function getCount($where){
        $this->setDb();
        return $this->db->from($this->_tableName)->join('han_goods_common','han_goods_common.goods_commonid = han_store_coupon_goods.goods_commonid','inner')->where($where)->fetchNum();
    }

    /**
     * 类实例
     *
     * @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;
    }


}
