Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
unknown
9 years ago
Commit
bde931fb72f3a2249a5b4a144fe1f7fabf6e5fa1
2 parents
c7885aac
61f9ac7c
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
40 deletions
library/Plugin/Cache.php
library/Plugin/HelperSearch.php
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
yohobuy/www.yohobuy.com/application/models/Product/Search.php
library/Plugin/Cache.php
View file @
bde931f
...
...
@@ -35,20 +35,22 @@ class Cache
*/
public
static
function
set
(
$key
,
$value
,
$expire
=
3600
)
{
try
{
// WINDOWS
if
(
DIRECTORY_SEPARATOR
===
'\\'
)
{
HoodCache
::
Memcache
(
'master'
)
->
set
(
self
::
makeKey
(
$key
,
'master'
),
$value
,
$expire
);
HoodCache
::
Memcache
(
'slave'
)
->
set
(
self
::
makeKey
(
$key
,
'slave'
),
$value
,
86400
);
// 二级缓存1天
}
// LINUX
else
{
HoodCache
::
Memcached
(
'master'
)
->
set
(
self
::
makeKey
(
$key
,
'master'
),
$value
,
$expire
);
HoodCache
::
Memcached
(
'slave'
)
->
set
(
self
::
makeKey
(
$key
,
'slave'
),
$value
,
86400
);
// 二级缓存1天
}
}
catch
(
Exception
$e
)
{
// do nothing
}
if
(
USE_CACHE
)
{
try
{
// WINDOWS
if
(
DIRECTORY_SEPARATOR
===
'\\'
)
{
HoodCache
::
Memcache
(
'master'
)
->
set
(
self
::
makeKey
(
$key
,
'master'
),
$value
,
$expire
);
HoodCache
::
Memcache
(
'slave'
)
->
set
(
self
::
makeKey
(
$key
,
'slave'
),
$value
,
86400
);
// 二级缓存1天
}
// LINUX
else
{
HoodCache
::
Memcached
(
'master'
)
->
set
(
self
::
makeKey
(
$key
,
'master'
),
$value
,
$expire
);
HoodCache
::
Memcached
(
'slave'
)
->
set
(
self
::
makeKey
(
$key
,
'slave'
),
$value
,
86400
);
// 二级缓存1天
}
}
catch
(
Exception
$e
)
{
// do nothing
}
}
}
/**
...
...
@@ -61,20 +63,20 @@ class Cache
public
static
function
get
(
$key
,
$node
=
'master'
)
{
$result
=
array
();
try
{
// WINDOWS
if
(
DIRECTORY_SEPARATOR
===
'\\'
)
{
$result
=
HoodCache
::
Memcache
(
$node
)
->
get
(
self
::
makeKey
(
$key
,
$node
));
}
// LINUX
else
{
$result
=
HoodCache
::
Memcached
(
$node
)
->
get
(
self
::
makeKey
(
$key
,
$node
));
}
}
catch
(
Exception
$e
)
{
$result
=
array
();
if
(
USE_CACHE
)
{
try
{
// WINDOWS
if
(
DIRECTORY_SEPARATOR
===
'\\'
)
{
$result
=
HoodCache
::
Memcache
(
$node
)
->
get
(
self
::
makeKey
(
$key
,
$node
));
}
// LINUX
else
{
$result
=
HoodCache
::
Memcached
(
$node
)
->
get
(
self
::
makeKey
(
$key
,
$node
));
}
}
catch
(
Exception
$e
)
{
$result
=
array
();
}
}
return
$result
;
}
...
...
@@ -86,16 +88,18 @@ class Cache
*/
public
static
function
delete
(
$key
)
{
// WINDOWS
if
(
DIRECTORY_SEPARATOR
===
'\\'
)
{
HoodCache
::
Memcache
(
'master'
)
->
delete
(
self
::
makeKey
(
$key
,
'master'
));
HoodCache
::
Memcache
(
'slave'
)
->
delete
(
self
::
makeKey
(
$key
,
'slave'
));
}
// LINUX
else
{
HoodCache
::
Memcached
(
'master'
)
->
delete
(
self
::
makeKey
(
$key
,
'master'
));
HoodCache
::
Memcached
(
'slave'
)
->
delete
(
self
::
makeKey
(
$key
,
'slave'
));
}
if
(
USE_CACHE
)
{
// WINDOWS
if
(
DIRECTORY_SEPARATOR
===
'\\'
)
{
HoodCache
::
Memcache
(
'master'
)
->
delete
(
self
::
makeKey
(
$key
,
'master'
));
HoodCache
::
Memcache
(
'slave'
)
->
delete
(
self
::
makeKey
(
$key
,
'slave'
));
}
// LINUX
else
{
HoodCache
::
Memcached
(
'master'
)
->
delete
(
self
::
makeKey
(
$key
,
'master'
));
HoodCache
::
Memcached
(
'slave'
)
->
delete
(
self
::
makeKey
(
$key
,
'slave'
));
}
}
}
/**
...
...
library/Plugin/HelperSearch.php
View file @
bde931f
...
...
@@ -292,7 +292,7 @@ class HelperSearch
{
$result
=
array
();
$options
=
self
::
$options
;
if
(
!
isset
(
$options
[
'controller'
])
||
$options
[
'controller'
]
=
=
'Search'
)
{
if
(
!
isset
(
$options
[
'controller'
])
||
$options
[
'controller'
]
!
=
'Search'
)
{
return
$result
;
}
$params
=
self
::
$params
;
...
...
yohobuy/m.yohobuy.com/application/models/Product/Detail.php
View file @
bde931f
...
...
@@ -242,11 +242,14 @@ class DetailModel
++
$i
;
}
// 遍历所有颜色, 构建尺码显示数据
$i
=
1
;
foreach
(
$colorList
as
$value
)
{
// 各个尺码的颜色,每行显示一个颜色的对应尺码
$sizeGroup
[][
'size'
]
=
$sizeList
[
$value
[
'skcId'
]
];
$sizeGroup
[
$i
][
'size'
]
=
$sizeList
[
$value
[
'skcId'
]
];
// 默认颜色
$colorGroup
[
0
][
'color'
][]
=
$value
;
++
$i
;
}
// 商品图: 多个
...
...
@@ -275,6 +278,8 @@ class DetailModel
$notForSale
=
$baseInfo
[
'attribute'
]
==
2
;
// 显示加入购物车链接
if
(
!
$soldOut
&&
!
$notForSale
)
{
ksort
(
$colorGroup
,
SORT_NUMERIC
);
$result
[
'cartInfo'
][
'addToCartUrl'
]
=
Helpers
::
url
(
'/product/buy_'
.
$productId
.
'_'
.
$goodsId
.
'.html'
);
$result
[
'cartInfo'
][
'productId'
]
=
$productId
;
$result
[
'cartInfo'
][
'thumbs'
]
=
$thumbImageList
;
...
...
yohobuy/www.yohobuy.com/application/models/Product/Search.php
View file @
bde931f
...
...
@@ -150,7 +150,7 @@ class SearchModel
// 组合搜索折扣区间url
$urlList
[
'discount'
]
=
HelperSearch
::
getDiscountUrl
(
$searchCondition
[
'condition'
]);
// 组合搜索最新上架url
$urlList
[
'recent'
]
=
HelperSearch
::
getRecentShelveUrl
(
$searchCondition
[
'condition'
]);
//
$urlList['recent'] = HelperSearch::getRecentShelveUrl($searchCondition['condition']);
//用户浏览记录
//$urlList['reviewUrl'] = HelperSearch::getReviewUrl($searchCondition['condition']);
...
...
Please
register
or
login
to post a comment