<?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($d4RRw) { return self::id() > 0 && self::id() == $d4RRw; } public static function isNotMine($d4RRw) { return !self::isMine($d4RRw); } public static function isLogin() { return self::id() > 0; } public static function isNotLogin() { return !self::isLogin(); } public static function isGroup($Vf2LG) { goto l2Ae3; Lkb_O: $WhnW5 = intval(self::get('groupId', 0)); goto HeoOG; R_EXz: if (!is_array($Vf2LG)) { $Vf2LG = array(intval($Vf2LG)); } goto Lkb_O; l2Ae3: if (self::isNotLogin()) { return false; } goto R_EXz; HeoOG: if ($WhnW5 == 0) { $WhnW5 = MemberGroupUtil::defaultGroupId(); } goto O1_AN; O1_AN: return in_array($WhnW5, $Vf2LG); goto IJ2m6; IJ2m6: } public static function isVip($iWqZy) { goto H0okF; h_OzI: $aZLH0 = MemberVipUtil::getMemberVip(self::user()); goto Kpw7W; jaFlD: if (!is_array($iWqZy)) { $iWqZy = array(intval($iWqZy)); } goto h_OzI; Kpw7W: $AkQUn = 0; goto hKUR4; H0okF: if (self::isNotLogin()) { return false; } goto jaFlD; hKUR4: if (!empty($aZLH0)) { $AkQUn = $aZLH0['id']; } goto jizr5; jizr5: return in_array($AkQUn, $iWqZy); goto R1m54; R1m54: } public static function get($rY0hM = null, $JYlLP = null) { goto JfRPk; rsQV7: return isset($CVZ2U[$rY0hM]) ? $CVZ2U[$rY0hM] : $JYlLP; goto romwY; JfRPk: $CVZ2U = self::user(); goto ghHDN; ghHDN: if (null === $rY0hM) { return $CVZ2U; } goto rsQV7; romwY: } public static function nickname() { return MemberUtil::viewName(self::user()); } }