...
|
...
|
@@ -59,7 +59,6 @@ class RecomController extends AbstractAction |
|
|
$data['goods'][] = Helpers::formatProduct($value, true);
|
|
|
}
|
|
|
$this->_view->display('maylike', $data);
|
|
|
|
|
|
} while (false);
|
|
|
|
|
|
echo ' ';
|
...
|
...
|
@@ -121,31 +120,64 @@ class RecomController extends AbstractAction |
|
|
break;
|
|
|
}
|
|
|
|
|
|
/* 创意生活只有一页数据 */
|
|
|
$page = $this->get('page', 1);
|
|
|
if (intval($page) > 1) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
/* 取可能喜欢的数据 */
|
|
|
$recom = RecomData::mayLikeLifestyle();
|
|
|
if (empty($recom['data']['product_list'])) {
|
|
|
|
|
|
/* 构建人气单品数据 */
|
|
|
if (empty($recom['top']['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);
|
|
|
foreach ($recom['top']['data']['product_list'] as $value) {
|
|
|
$build['goods'][] = Helpers::formatProduct($value, true, false, false);
|
|
|
}
|
|
|
$data['goodsContainer'][] = $build;
|
|
|
|
|
|
/* 构建新品到着数据 */
|
|
|
if (empty($recom['new']['data']['product_list'])) {
|
|
|
break;
|
|
|
}
|
|
|
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);
|
|
|
$build['show'] = true;
|
|
|
foreach ($recom['new']['data']['product_list'] as $value) {
|
|
|
$build['goods'][] = Helpers::formatProduct($value, true, false, false);
|
|
|
}
|
|
|
$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;
|
|
|
// }
|
|
|
|
|
|
$this->_view->display('maylikelife', $data);
|
|
|
|
|
|
} while (false);
|
...
|
...
|
|