Browse Source

checkredis

yijia
娄梦宁 7 years ago
parent
commit
5bbf06488c
1 changed files with 23 additions and 9 deletions
  1. +23
    -9
      addons/unishop/controller/User.php

+ 23
- 9
addons/unishop/controller/User.php View File

@@ -38,18 +38,32 @@ class User extends Base
$ret = $this->auth->login($mobile, $password);
if ($ret) {
$data = $this->auth->getUserinfo();
$ordinary_user_start=Config::getByName('ordinary_user_start')['value'];
$ordinary_user_end=Config::getByName('ordinary_user_end')['value'];
$ordinary_user_start=strtotime($ordinary_user_start);
$ordinary_user_end=strtotime($ordinary_user_end);
if (time()<$ordinary_user_end && time()>$ordinary_user_start){
$privilege_user_list=Config::getByName('privilege_user_list')['value'];
$privilege_user_list=explode(",",$privilege_user_list);
if (!in_array($data['id'],$privilege_user_list)){
//普通用户
//普通用户受限制时间
$privilege_user_list=Config::getByName('privilege_user_list')['value'];
$privilege_user_list=explode(",",$privilege_user_list);
if (!in_array($data['id'],$privilege_user_list)){
$this->success('It\'s not time to open', $data);
$ordinary_user_start=Config::getByName('ordinary_user_start')['value'];
$ordinary_user_end=Config::getByName('ordinary_user_end')['value'];
$ordinary_user_start=strtotime($ordinary_user_start);
$ordinary_user_end=strtotime($ordinary_user_end);
if (time()<$ordinary_user_end && time()>$ordinary_user_start){
$this->auth->logout();
$this->error('It\'s not time to open', $data);
}
}else{
//特权用户
$privilege_user_start=Config::getByName('privilege_user_start')['value'];
$privilege_user_end=Config::getByName('privilege_user_end')['value'];
$privilege_user_start=strtotime($privilege_user_start);
$privilege_user_end=strtotime($privilege_user_end);
if (time()<$privilege_user_end && time()>$privilege_user_start){
$this->auth->logout();
$this->error('It\'s not time to open', $data);
}
}


$data['avatar'] = \addons\unishop\model\Config::getImagesFullUrl($data['avatar']);
$this->success('Logged in successful', $data);
} else {


Loading…
Cancel
Save