Authored by hf

code review by fei.hong: do merge yang.yang and shaofeng.zhou fixes bugs codes

... ... @@ -681,10 +681,13 @@ class ItemModel
//判断是否显示参考尺码
if ($boyReference && ($gender == 1 || $gender == 3) && $showReference) {
$sizes[] = empty($value['boyReferSize']['referenceName']) ? ' ' : $value['boyReferSize']['referenceName'];
} elseif ($girlReference && ($gender == 2 || $gender == 3) && $showReference) {
} else if ($girlReference && ($gender == 2 || $gender == 3) && $showReference) {
$sizes[] = empty($value['girlReferSize']['referenceName']) ? ' ' : $value['girlReferSize']['referenceName'];
} else {
if(isset($size['thead'][1]) && $showReference) {
$size['thead'][1] = array();
}
}
//其他尺码信息
foreach ($value['sortAttributes'] as $attr) {
$sizes[] = empty($attr['sizeValue']) ? ' ' : $attr['sizeValue'];
... ... @@ -692,7 +695,11 @@ class ItemModel
//尺码信息
$size['tbody'][] = $sizes;
}
//参考尺码为空
if(isset($size['thead'][1]) && empty(($size['thead'][1])) && $showReference) {
unset($size['thead'][1]);
$size['thead'] = array_values($size['thead']);
}
}
}
... ...
... ... @@ -21,8 +21,9 @@ class LoginController extends WebAction
{
$this->setTitle('用户登录', true, ' | ');
// 设置登录有效时间30分钟, 防机器刷
$this->setSession('_LOGIN_EXPIRE', time() + 1800);
// 设置登录有效时间30分钟, 防机器刷,cache不稳定,改为cookie
$this->setCookie('LE'.md5('_LOGIN_EXPIRE'),time() + 1800);
// $this->setSession('_LOGIN_EXPIRE', time() + 1800);
// 设置公共的头部
$this->setSimpleHeader();
... ... @@ -122,7 +123,8 @@ class LoginController extends WebAction
}
/* 设置登录有效时间30分钟, 防机器刷 */
$expire = $this->getSession('_LOGIN_EXPIRE');
$expire = $this->getCookie('LE'.md5('_LOGIN_EXPIRE'));
// $expire = $this->getSession('_LOGIN_EXPIRE');
if (empty($expire) || $expire < time()) {
$data = array('code' => 400, 'message' => '页面停留时间过长,请刷新页面', 'data' => '');
break;
... ...