合肥金麓客户积分系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

22 lines
552 B

<?php
namespace app\user\model;
use think\Model;
class Users extends Model
{
public function login($data){
$user=db('users')->where('email',$data['email'])->find();
if($user){
if($user['password'] == md5($data['password'])){
session('nickname',$user['nickname']);
session('uid',$user['user_id']);
return 1; //信息正确
}else{
return -1; //密码错误
}
}else{
return -1; //用户不存在
}
}
}