code review by fei.hong: do merge yang.yang and shaofeng.zhou fixes bugs codes
Showing
2 changed files
with
15 additions
and
6 deletions
@@ -681,10 +681,13 @@ class ItemModel | @@ -681,10 +681,13 @@ class ItemModel | ||
681 | //判断是否显示参考尺码 | 681 | //判断是否显示参考尺码 |
682 | if ($boyReference && ($gender == 1 || $gender == 3) && $showReference) { | 682 | if ($boyReference && ($gender == 1 || $gender == 3) && $showReference) { |
683 | $sizes[] = empty($value['boyReferSize']['referenceName']) ? ' ' : $value['boyReferSize']['referenceName']; | 683 | $sizes[] = empty($value['boyReferSize']['referenceName']) ? ' ' : $value['boyReferSize']['referenceName']; |
684 | - } elseif ($girlReference && ($gender == 2 || $gender == 3) && $showReference) { | 684 | + } else if ($girlReference && ($gender == 2 || $gender == 3) && $showReference) { |
685 | $sizes[] = empty($value['girlReferSize']['referenceName']) ? ' ' : $value['girlReferSize']['referenceName']; | 685 | $sizes[] = empty($value['girlReferSize']['referenceName']) ? ' ' : $value['girlReferSize']['referenceName']; |
686 | + } else { | ||
687 | + if(isset($size['thead'][1]) && $showReference) { | ||
688 | + $size['thead'][1] = array(); | ||
689 | + } | ||
686 | } | 690 | } |
687 | - | ||
688 | //其他尺码信息 | 691 | //其他尺码信息 |
689 | foreach ($value['sortAttributes'] as $attr) { | 692 | foreach ($value['sortAttributes'] as $attr) { |
690 | $sizes[] = empty($attr['sizeValue']) ? ' ' : $attr['sizeValue']; | 693 | $sizes[] = empty($attr['sizeValue']) ? ' ' : $attr['sizeValue']; |
@@ -692,7 +695,11 @@ class ItemModel | @@ -692,7 +695,11 @@ class ItemModel | ||
692 | //尺码信息 | 695 | //尺码信息 |
693 | $size['tbody'][] = $sizes; | 696 | $size['tbody'][] = $sizes; |
694 | } | 697 | } |
695 | - | 698 | + //参考尺码为空 |
699 | + if(isset($size['thead'][1]) && empty(($size['thead'][1])) && $showReference) { | ||
700 | + unset($size['thead'][1]); | ||
701 | + $size['thead'] = array_values($size['thead']); | ||
702 | + } | ||
696 | } | 703 | } |
697 | } | 704 | } |
698 | 705 |
@@ -21,8 +21,9 @@ class LoginController extends WebAction | @@ -21,8 +21,9 @@ class LoginController extends WebAction | ||
21 | { | 21 | { |
22 | $this->setTitle('用户登录', true, ' | '); | 22 | $this->setTitle('用户登录', true, ' | '); |
23 | 23 | ||
24 | - // 设置登录有效时间30分钟, 防机器刷 | ||
25 | - $this->setSession('_LOGIN_EXPIRE', time() + 1800); | 24 | + // 设置登录有效时间30分钟, 防机器刷,cache不稳定,改为cookie |
25 | + $this->setCookie('LE'.md5('_LOGIN_EXPIRE'),time() + 1800); | ||
26 | +// $this->setSession('_LOGIN_EXPIRE', time() + 1800); | ||
26 | // 设置公共的头部 | 27 | // 设置公共的头部 |
27 | $this->setSimpleHeader(); | 28 | $this->setSimpleHeader(); |
28 | 29 | ||
@@ -122,7 +123,8 @@ class LoginController extends WebAction | @@ -122,7 +123,8 @@ class LoginController extends WebAction | ||
122 | } | 123 | } |
123 | 124 | ||
124 | /* 设置登录有效时间30分钟, 防机器刷 */ | 125 | /* 设置登录有效时间30分钟, 防机器刷 */ |
125 | - $expire = $this->getSession('_LOGIN_EXPIRE'); | 126 | + $expire = $this->getCookie('LE'.md5('_LOGIN_EXPIRE')); |
127 | +// $expire = $this->getSession('_LOGIN_EXPIRE'); | ||
126 | if (empty($expire) || $expire < time()) { | 128 | if (empty($expire) || $expire < time()) { |
127 | $data = array('code' => 400, 'message' => '页面停留时间过长,请刷新页面', 'data' => ''); | 129 | $data = array('code' => 400, 'message' => '页面停留时间过长,请刷新页面', 'data' => ''); |
128 | break; | 130 | break; |
-
Please register or login to post a comment