feat : site cache
This commit is contained in:
@@ -60,8 +60,12 @@ class SiteCache
|
|||||||
|
|
||||||
$siteKey = CommonRedisKey::siteListKey();
|
$siteKey = CommonRedisKey::siteListKey();
|
||||||
|
|
||||||
$siteList = json_decode($this->redis->get($siteKey), true);
|
$siteListJsonDecode = json_decode($this->redis->get($siteKey,RedisCode::SYSTEM_DB), true);
|
||||||
|
if (empty($siteListJsonDecode)) return null;
|
||||||
|
|
||||||
|
$siteList = array_column($siteListJsonDecode, null, 'id');
|
||||||
|
|
||||||
|
unset($siteListJsonDecode);
|
||||||
return $siteList[$siteId] ?? null;
|
return $siteList[$siteId] ?? null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -43,7 +43,7 @@ class OptionalListService extends BaseService
|
|||||||
{
|
{
|
||||||
$cycleId = $this->initTodayCycleId();
|
$cycleId = $this->initTodayCycleId();
|
||||||
|
|
||||||
if (empty($cycleId)) return ['list' => []];
|
if (empty($cycleId)) return $this->return->success('success', ['list' => []]);
|
||||||
|
|
||||||
$this->goodCache->cycleId = (int)$cycleId;
|
$this->goodCache->cycleId = (int)$cycleId;
|
||||||
$siteInfo = $this->siteCache->getSiteInfo((int)$this->request->input('site_id'));
|
$siteInfo = $this->siteCache->getSiteInfo((int)$this->request->input('site_id'));
|
||||||
|
|||||||
Reference in New Issue
Block a user