<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Auth; use Illuminate\Support\Facades\Session; use Module\Member\Util\MemberGroupUtil; use Module\Member\Util\MemberUtil; use Module\Member\Util\MemberVipUtil; class MemberUser { public static function id() { return intval(Session::get('memberUserId', 0)); } public static function user() { return Session::get('_memberUser', null); } public static function isMine($shbIl) { return self::id() > 0 && self::id() == $shbIl; } public static function isNotMine($shbIl) { return !self::isMine($shbIl); } public static function isLogin() { return self::id() > 0; } public static function isNotLogin() { return !self::isLogin(); } public static function isGroup($Fbq3Y) { goto KeY2i; oV4MY: return in_array($EH9U1, $Fbq3Y); goto T0pTR; KZmY4: if ($EH9U1 == 0) { $EH9U1 = MemberGroupUtil::defaultGroupId(); } goto oV4MY; PmAVd: $EH9U1 = intval(self::get('groupId', 0)); goto KZmY4; HSI2o: if (!is_array($Fbq3Y)) { $Fbq3Y = array(intval($Fbq3Y)); } goto PmAVd; KeY2i: if (self::isNotLogin()) { return false; } goto HSI2o; T0pTR: } public static function isVip($BrM2v) { goto ZGHNT; ZGHNT: if (self::isNotLogin()) { return false; } goto yY7z3; yY7z3: if (!is_array($BrM2v)) { $BrM2v = array(intval($BrM2v)); } goto NHQ2z; aNfrz: if (!empty($XU_d8)) { $n2ZWE = $XU_d8['id']; } goto B0i62; NHQ2z: $XU_d8 = MemberVipUtil::getMemberVip(self::user()); goto qPUs8; B0i62: return in_array($n2ZWE, $BrM2v); goto NYYru; qPUs8: $n2ZWE = 0; goto aNfrz; NYYru: } public static function get($sFwJk = null, $QF10u = null) { goto AkdJW; AkdJW: $oug3E = self::user(); goto Ns8gC; Ns8gC: if (null === $sFwJk) { return $oug3E; } goto djB43; djB43: return isset($oug3E[$sFwJk]) ? $oug3E[$sFwJk] : $QF10u; goto BSL2c; BSL2c: } public static function nickname() { return MemberUtil::viewName(self::user()); } }