<?php
/**
 * @copyright ONE/DEPO Project
 * @license   PHP License 3.01 <http://www.php.net/license/3_01.txt>
 */


/**
 * 新規会員テーブル関連
 *
 * @package     Onedepo.Db.Member.Member
 * @author      FUCO Tominaga
 * @access      public
 */
class Onedepo_Db_Member_Mypage
{
    var $dbaccess;

    function checkStatus($MemberCd)
    {
        $log =& LogFactory::getLog();
        $func_name = "Onedepo_Db_Member_Mypage#checkStatus";
        
        $db = $this->dbaccess->doConnect();
        $db->setFetchMode(DB_FETCHMODE_ASSOC);

        $params = array($MemberCd);
        $sql = "SELECT 
                member.membercd AS mcd, 
                consumer.membercd AS ccd, 
                seller.membercd AS scd, 
                CASE WHEN member.nicknm IS NULL 
                AND       member.birthdate IS NULL 
                AND       member.selfintro IS NULL 
                THEN NULL
                ELSE member.membercd
                END AS morecd

                FROM 
                (t_member_basic_attr member 
                    LEFT JOIN t_consumer_attr consumer ON member.membercd = consumer.membercd) 
                    LEFT JOIN t_seller_attr   seller   ON member.membercd = seller.membercd AND seller.sellerstate=2
                WHERE member.membercd = ?";
        $data = $db->getRow($sql, $params);

        if (DB::isError($data) || !$data) {
            $log->debug($data->userinfo, $func_name);
            die($data->getMessage());
        }
        $this->dbaccess->doClose($db);
        return $data;
    }

}
?>
