Authored by hf

code review by fei.hong : fixes bugs to go boys

... ... @@ -471,7 +471,7 @@ class WebAction extends Controller_Abstract
protected function setWebNavHeader($channel = '')
{
if(!empty($channel)) {//设置频道
//\Index\HomeModel::setSwitchToCookie($channel);
\Index\HomeModel::setSwitchToCookie($channel);
} else {
$channel = \Index\HomeModel::getSwitchChannel();
}
... ...
... ... @@ -14,24 +14,30 @@ class IndexController extends WebAction
*/
public function indexAction()
{
if (null !== $this->get('go')) {
// 先检查COOKIE是否有访问过, 有则跳转到相应的频道页
HomeModel::goSwitchChannel();
} else {
// 设置客户端浏览器1分钟内不改变
$this->setLastModified(mktime(date('H'), date('i'), 0, date('n'), date('j'), date('Y')));
// 设置浏览器缓存1分钟
$this->setExpires(60);
if (isset($_COOKIE['_Channel'])) {
unset($_COOKIE['_Channel']);
}
// 传递模板数据,渲染模板
$this->setWebNavHeader(HomeModel::COOKIE_NAME_BOYS);
$data = array(
'boysHomePage' => true,
'footerTop'=> true,
'boys' => HomeModel::getChannelResource(HomeModel::COOKIE_NAME_BOYS, HomeModel::CODE_BOYS_CHANNEL)
);
$this->_view->display('index', $data);
$this->go('http://www.yohobuy.com');
// if (null !== $this->get('go')) {
// // 先检查COOKIE是否有访问过, 有则跳转到相应的频道页
// HomeModel::goSwitchChannel();
// } else {
// // 设置客户端浏览器1分钟内不改变
// $this->setLastModified(mktime(date('H'), date('i'), 0, date('n'), date('j'), date('Y')));
// // 设置浏览器缓存1分钟
// $this->setExpires(60);
// }
//
// // 传递模板数据,渲染模板
// $this->setWebNavHeader(HomeModel::COOKIE_NAME_BOYS);
// $data = array(
// 'boysHomePage' => true,
// 'footerTop'=> true,
// 'boys' => HomeModel::getChannelResource(HomeModel::COOKIE_NAME_BOYS, HomeModel::CODE_BOYS_CHANNEL)
// );
// $this->_view->display('index', $data);
}
}
\ No newline at end of file
... ...