enterpriseId = $enterpriseId; $this->userCenterId = $userCenterId; $this->cache = Factory::cache('default'); } /**---------------------------------------------小程序首页------------------------------------------------**/ /** * 添加 * @param $md5Key * @param $pageData * @return bool */ public function addPage($md5Key, $pageData) { $data = json_encode($pageData); $result = $this->cache->hset($this->cacheKey, $md5Key, $data); if(!$result){ return false; } return true; } /** * 查询 * @param $md5Key * @return array */ public function getPage($md5Key) { $result = $this->cache->hget($this->cacheKey, $md5Key); if (!$result) return []; $returnData = json_decode($result, true); return $returnData; } /** * 删除 * @param $paegId */ public function delPage($paegId = false) { if($paegId){ $this->cache->hdel($this->cacheKey, $paegId); }else{ $this->cache->del($this->cacheKey); } } }