//确认用户登录信息
if($cfg_ml->IsLogin())
{
$userid = $cfg_ml->M_ID;
}
else
{
$username = trim($username);
$password = trim($password);
if(empty($username) || $password)
{
ShowMsg("请选登录!","-1",0,2000);
exit();
}
$rs = $cfg_ml->CheckUser($username,$password);
if($rs==0)
{
ShowMsg("用户名不存在!","-1",0,2000);
exit();
}
else if($rs==-1)
{
ShowMsg("密码错误!","-1",0,2000);
exit();
}
$userid = $cfg_ml->M_ID;
}
修改为如下代码:
//确认用户登录信息
if($cfg_ml->IsLogin())
{
$userid = $cfg_ml->M_ID;
}
else
{
$username = trim($username);
$password = trim($password);
if(empty($username) || $password)
{
$userid = 0;
}
else
{
$rs = $cfg_ml->CheckUser($username,$password);
if($rs==0)
{
ShowMsg("用户名不存在!","-1",0,2000);
exit();
}
else if($rs==-1)
{
ShowMsg("密码错误!","-1",0,2000);
exit();
}
$userid = $cfg_ml->M_ID;
}
}
修改的意思就是,如果用户没有登录,那我就把0赋值给 id,这样在后台只要看到是0下的订单,就是游客的。当然游客的话需要记录一些信息,方便查询订单。本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!