예제 #1
0
 /**
  * 根据id获得User完整信息
  * $needSpaceSize 是为了在循环中避免对miniyun_files表操作
  * @param $id
  * @param bool $needSpaceSize
  * @return array|null
  */
 public function getUser($id, $needSpaceSize = true)
 {
     if (array_key_exists($id, $this->userList)) {
         return $this->userList[$id];
     }
     $user = $this->get4Db($id);
     if ($needSpaceSize) {
         $user["usedSpace"] = $this->getUsedSize($id);
         //查询当前用户已经消耗的空间
         //如系统做了总空间控制,且空间已经使用完毕,则进行提示
         if (CUtils::hasOverSysSpace() === false) {
             $user["space"] = $user["usedSpace"] - 1;
         }
     }
     $this->userList[$id] = $user;
     return $user;
 }