first(); if (!$group) return []; $group = $group->toArray(); $this->set(strval($group_id), json_encode($group), 60 * 60 * 1); return $group; } /** * 获取或更新群组缓存 * * @param int $group_id 群组ID * @return array */ public function getOrSetCache(int $group_id): array { $cache = $this->get(strval($group_id)); return $cache ? json_decode($cache, true) : $this->updateCache($group_id); } }