소스 검색

checkredis

yijia
娄梦宁 7 년 전
부모
커밋
5bbf06488c
1개의 변경된 파일23개의 추가작업 그리고 9개의 파일을 삭제
  1. +23
    -9
      addons/unishop/controller/User.php

+ 23
- 9
addons/unishop/controller/User.php 파일 보기

@@ -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 {


불러오는 중...
취소
저장