select('id','uid','area','type','bid','flag')->first(); } public static function updateUser($uid,$data){ return BookUser::where('uid',$uid)->update($data); } public static function popUser($uid){ try{ Redis::srem('YQ_USER_TEST_BOOK:USER',$uid); }catch (\Exception $e){} } public static function isUserInRedis($uid){ return Redis::SISMEMBER('YQ_USER_TEST_BOOK:USER',$uid); } /** * 判断用户是否存在 * @param $uid * @return bool */ public static function selectUser($uid){ if(!self::isUserInRedis($uid)){ return null; } $user = self::getByUid($uid); return $user; } }