<?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($KJqKC) { return self::id() > 0 && self::id() == $KJqKC; } public static function isNotMine($KJqKC) { return !self::isMine($KJqKC); } public static function isLogin() { return self::id() > 0; } public static function isNotLogin() { return !self::isLogin(); } public static function isGroup($vfJTs) { goto L6Ojv; IilPI: $GlHcc = intval(self::get('groupId', 0)); goto gW8H4; gW8H4: if ($GlHcc == 0) { $GlHcc = MemberGroupUtil::defaultGroupId(); } goto yJGqp; L6Ojv: if (self::isNotLogin()) { return false; } goto Pn8i7; Pn8i7: if (!is_array($vfJTs)) { $vfJTs = array(intval($vfJTs)); } goto IilPI; yJGqp: return in_array($GlHcc, $vfJTs); goto ZekpG; ZekpG: } public static function isVip($Y4CY2) { goto TbsH0; wu1a1: $JTwKA = 0; goto ihjXa; GTPdr: return in_array($JTwKA, $Y4CY2); goto iOvm8; MJLoJ: if (!is_array($Y4CY2)) { $Y4CY2 = array(intval($Y4CY2)); } goto tVGr1; tVGr1: $SeeMj = MemberVipUtil::getMemberVip(self::user()); goto wu1a1; ihjXa: if (!empty($SeeMj)) { $JTwKA = $SeeMj['id']; } goto GTPdr; TbsH0: if (self::isNotLogin()) { return false; } goto MJLoJ; iOvm8: } public static function get($UtKOH = null, $uvYG5 = null) { goto wk1Ep; LtFFZ: if (null === $UtKOH) { return $nsToJ; } goto cdCo1; cdCo1: return isset($nsToJ[$UtKOH]) ? $nsToJ[$UtKOH] : $uvYG5; goto a09lk; wk1Ep: $nsToJ = self::user(); goto LtFFZ; a09lk: } public static function nickname() { return MemberUtil::viewName(self::user()); } }