<?php

namespace App\Http\Controllers\Fpdx;

use Illuminate\Support\Facades\Redis;
use App\Http\Controllers\Controller;

class Tag extends Controller
{
    /**
     * 获取某人的tag
     * @param  int  $uid
     * @return array|mixed
     */
    public static function getTagByUid(int $uid)
    {
        if ($json_tags = Redis::get("charge_user_tag_{$uid}")) {
            $tags = json_decode($json_tags, true);
            return $tags;
        } else {
            return [];
        }
    }
}
