Authored by 郝肖肖

新品到着和人气单品添加缓存

... ... @@ -74,7 +74,7 @@ class RecomData
$param['yh_channel'] = '4';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
return Yohobuy::get(Yohobuy::API_URL, $param, 3600);
}
}
... ...
... ... @@ -119,6 +119,7 @@ class RecomController extends AbstractAction
*/
public function maylikeLifeAction()
{
$data = array();
do {
/* 判断是否是AJAX请求 */
if (!$this->isAjax()) {
... ... @@ -158,36 +159,9 @@ class RecomController extends AbstractAction
}
$data['goodsContainer'][] = $build;
// if (empty($recom['data']['product_list'])) {
// break;
// }
//
// /* 构建模板需要的商品数据 */
// $data = array();
// $build = array();
// if (!empty($recom['data']['product_list']['top'])) {
// $build = array();
// $build['show'] = true;
// foreach ($recom['data']['product_list']['top'] as $value) {
// $build['goods'][] = Helpers::formatProduct($value, true);
// }
// $data['goodsContainer'][] = $build;
// }
// if (!empty($recom['data']['product_list']['new'])) {
// $build = array();
// foreach ($recom['data']['product_list']['new'] as $value) {
// $build['show'] = false;
// $build['goods'][] = Helpers::formatProduct($value, true);
// }
// $data['goodsContainer'][] = $build;
// }
} while (false);
if (isset($data)) {
$this->_view->display('maylikelife', $data);
} else {
echo ' ';
}
}
}
... ...