Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
4 changed files
with
14 additions
and
5 deletions
@@ -35,6 +35,7 @@ class Cache | @@ -35,6 +35,7 @@ class Cache | ||
35 | */ | 35 | */ |
36 | public static function set($key, $value, $expire = 3600) | 36 | public static function set($key, $value, $expire = 3600) |
37 | { | 37 | { |
38 | + if(USE_CACHE) { | ||
38 | try { | 39 | try { |
39 | // WINDOWS | 40 | // WINDOWS |
40 | if (DIRECTORY_SEPARATOR === '\\') { | 41 | if (DIRECTORY_SEPARATOR === '\\') { |
@@ -50,6 +51,7 @@ class Cache | @@ -50,6 +51,7 @@ class Cache | ||
50 | // do nothing | 51 | // do nothing |
51 | } | 52 | } |
52 | } | 53 | } |
54 | + } | ||
53 | 55 | ||
54 | /** | 56 | /** |
55 | * 获取缓存 | 57 | * 获取缓存 |
@@ -61,7 +63,7 @@ class Cache | @@ -61,7 +63,7 @@ class Cache | ||
61 | public static function get($key, $node = 'master') | 63 | public static function get($key, $node = 'master') |
62 | { | 64 | { |
63 | $result = array(); | 65 | $result = array(); |
64 | - | 66 | + if(USE_CACHE) { |
65 | try { | 67 | try { |
66 | // WINDOWS | 68 | // WINDOWS |
67 | if (DIRECTORY_SEPARATOR === '\\') { | 69 | if (DIRECTORY_SEPARATOR === '\\') { |
@@ -74,7 +76,7 @@ class Cache | @@ -74,7 +76,7 @@ class Cache | ||
74 | } catch (Exception $e) { | 76 | } catch (Exception $e) { |
75 | $result = array(); | 77 | $result = array(); |
76 | } | 78 | } |
77 | - | 79 | + } |
78 | return $result; | 80 | return $result; |
79 | } | 81 | } |
80 | 82 | ||
@@ -86,6 +88,7 @@ class Cache | @@ -86,6 +88,7 @@ class Cache | ||
86 | */ | 88 | */ |
87 | public static function delete($key) | 89 | public static function delete($key) |
88 | { | 90 | { |
91 | + if(USE_CACHE) { | ||
89 | // WINDOWS | 92 | // WINDOWS |
90 | if (DIRECTORY_SEPARATOR === '\\') { | 93 | if (DIRECTORY_SEPARATOR === '\\') { |
91 | HoodCache::Memcache('master')->delete(self::makeKey($key, 'master')); | 94 | HoodCache::Memcache('master')->delete(self::makeKey($key, 'master')); |
@@ -97,6 +100,7 @@ class Cache | @@ -97,6 +100,7 @@ class Cache | ||
97 | HoodCache::Memcached('slave')->delete(self::makeKey($key, 'slave')); | 100 | HoodCache::Memcached('slave')->delete(self::makeKey($key, 'slave')); |
98 | } | 101 | } |
99 | } | 102 | } |
103 | + } | ||
100 | 104 | ||
101 | /** | 105 | /** |
102 | * 生成键名 | 106 | * 生成键名 |
@@ -292,7 +292,7 @@ class HelperSearch | @@ -292,7 +292,7 @@ class HelperSearch | ||
292 | { | 292 | { |
293 | $result = array(); | 293 | $result = array(); |
294 | $options = self::$options; | 294 | $options = self::$options; |
295 | - if (!isset($options['controller']) || $options['controller'] == 'Search') { | 295 | + if (!isset($options['controller']) || $options['controller'] != 'Search') { |
296 | return $result; | 296 | return $result; |
297 | } | 297 | } |
298 | $params = self::$params; | 298 | $params = self::$params; |
@@ -242,11 +242,14 @@ class DetailModel | @@ -242,11 +242,14 @@ class DetailModel | ||
242 | ++ $i; | 242 | ++ $i; |
243 | } | 243 | } |
244 | // 遍历所有颜色, 构建尺码显示数据 | 244 | // 遍历所有颜色, 构建尺码显示数据 |
245 | + $i = 1; | ||
245 | foreach ($colorList as $value) { | 246 | foreach ($colorList as $value) { |
246 | // 各个尺码的颜色,每行显示一个颜色的对应尺码 | 247 | // 各个尺码的颜色,每行显示一个颜色的对应尺码 |
247 | - $sizeGroup[]['size'] = $sizeList[ $value['skcId'] ]; | 248 | + $sizeGroup[$i]['size'] = $sizeList[ $value['skcId'] ]; |
248 | // 默认颜色 | 249 | // 默认颜色 |
249 | $colorGroup[0]['color'][] = $value; | 250 | $colorGroup[0]['color'][] = $value; |
251 | + | ||
252 | + ++ $i; | ||
250 | } | 253 | } |
251 | 254 | ||
252 | // 商品图: 多个 | 255 | // 商品图: 多个 |
@@ -275,6 +278,8 @@ class DetailModel | @@ -275,6 +278,8 @@ class DetailModel | ||
275 | $notForSale = $baseInfo['attribute'] == 2; | 278 | $notForSale = $baseInfo['attribute'] == 2; |
276 | // 显示加入购物车链接 | 279 | // 显示加入购物车链接 |
277 | if (!$soldOut && !$notForSale) { | 280 | if (!$soldOut && !$notForSale) { |
281 | + ksort($colorGroup, SORT_NUMERIC); | ||
282 | + | ||
278 | $result['cartInfo']['addToCartUrl'] = Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html'); | 283 | $result['cartInfo']['addToCartUrl'] = Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html'); |
279 | $result['cartInfo']['productId'] = $productId; | 284 | $result['cartInfo']['productId'] = $productId; |
280 | $result['cartInfo']['thumbs'] = $thumbImageList; | 285 | $result['cartInfo']['thumbs'] = $thumbImageList; |
@@ -150,7 +150,7 @@ class SearchModel | @@ -150,7 +150,7 @@ class SearchModel | ||
150 | // 组合搜索折扣区间url | 150 | // 组合搜索折扣区间url |
151 | $urlList['discount'] = HelperSearch::getDiscountUrl($searchCondition['condition']); | 151 | $urlList['discount'] = HelperSearch::getDiscountUrl($searchCondition['condition']); |
152 | // 组合搜索最新上架url | 152 | // 组合搜索最新上架url |
153 | - $urlList['recent'] = HelperSearch::getRecentShelveUrl($searchCondition['condition']); | 153 | + //$urlList['recent'] = HelperSearch::getRecentShelveUrl($searchCondition['condition']); |
154 | //用户浏览记录 | 154 | //用户浏览记录 |
155 | //$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']); | 155 | //$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']); |
156 | 156 |
-
Please register or login to post a comment