Authored by 郝肖肖

客服缓存 cache getBy

... ... @@ -79,7 +79,7 @@ class AbstractAction extends Controller_Abstract
//客服配置
protected function getCustomerServiceSwitch() {
return $this->_useSession && empty($this->getCache('customerServiceSwitch')) ? 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409' : '/service/client';
return $this->_useSession && empty($this->getCacheBy('customerServiceSwitch')) ? 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409' : '/service/client';
}
/**
* 封装一下获取get参数
... ... @@ -297,6 +297,22 @@ class AbstractAction extends Controller_Abstract
}
/**
* 直接查询缓存,不对key做任何处理<php与node cache对接>
*
* @param string $key 键名
* @param bool $isMaster 控制是到主服务器取,还是到从服务器取缓存
* @return mixed
*/
protected function getCacheBy($key, $isMaster = true)
{
if ($isMaster) {
return Cache::getBy($key, 'master');
} else {
return Cache::getBy($key, 'slave');
}
}
/**
* 设置Session
*
* @param string $name 名称
... ...
... ... @@ -45,7 +45,7 @@ class UserModel
}
public static function getCustomerServiceSwitch() {
$customerServiceSwitch = USE_CACHE && empty(Cache::get('customerServiceSwitch')) ? 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409' : '/service/client';
$customerServiceSwitch = USE_CACHE && empty(Cache::getBy('customerServiceSwitch')) ? 'http://chat8.live800.com/live800/chatClient/chatbox.jsp?companyID=620092&configID=149091&jid=8732423409' : '/service/client';
}
/**
* 个人中心-左侧导航
... ...