<?php
/**
 * Created by PhpStorm.
 * User: stanley-king
 * Date: 2017/4/28
 * Time: 上午10:54
 */
namespace login;

class pub_userinfo_log extends ILogin
{
    private $mUserInfo;

    public function __construct($user_info)
    {
        $this->mUserInfo = $user_info;
    }

    public function ismember()
    {
        $mod_member = Model('member');
        $openid  = $this->mUserInfo['openid'];
        $unionid = $this->mUserInfo['unionid'];
        $cond['member_wxunionid|member_wxopenid'] = array('_multi'=>true,$unionid,$openid);
        $minfo = $mod_member->getMemberInfo($cond,ILogin::fields,true);

        if(empty($minfo)) {
            return false;
        }
        else {
            $this->mMemberId = intval($minfo['member_id']);
            $this->mMemberInfo = $minfo;
            return true;
        }
    }

    public function register($passwd,$user_info,$relay_id = 0)
    {

    }
}
