public function storeRedis() { $redis = new RedisBaseModel(Config::get('redis.redis_3.host'), Config::get('redis.redis_3.port'), false); $cacheKey = "URLTrack3rd"; $value = $this->getListActive(); $retval = $redis->set($cacheKey, $value); }
/** * * Enter Get province list * @param array $country_code country code */ public function getRegionByCountry($country_code = array()) { $redis = new RedisBaseModel(Config::get('redis.redis_3.host'), Config::get('redis.redis_3.port'), false); $result = array(); if (!empty($country_code)) { foreach ($country_code as $value) { $cacheKey = "GeoBaseModel:Region:{$value}"; $retval = $redis->get($cacheKey); if (!$retval) { $retval = DB::table('geo')->select('country_code', 'country_name', 'region')->groupBy('country_code', 'region')->where('region', '<>', '-')->where('country_code', $value)->get(); $redis->set($cacheKey, $retval); } $result = $this->meargeObj($result, $retval); } return $result; } else { return FALSE; } }