<?php
namespace Mysql;

/**
 * User: liuyuzhen
 * Date: 2018/5/8
 * Time: 10:20
 * Description:
 */
class AddressModel extends \Mysql\AbstractModel {

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

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

    public function findByWhereWithColumns($where,$columns){
        $address = $this->selectByWhereWithColumns($where,$columns);
        if($address){
            $address = $address[0];
        }
        return $address;
    }
    /**
     * 类实例

     * @var \Mysql\Slave\AddressModel
     */
    private static $_instance = null;


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

        return self::$_instance;
    }
}