...
|
...
|
@@ -47,8 +47,8 @@ class RecomController extends AbstractAction |
|
|
if (empty($recom['data']['product_list'])) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
/* 判断是否已没有数据 */
|
|
|
|
|
|
/* 判断是否已没有数据 */
|
|
|
if (intval($page) > intval($recom['data']['page_total'])) {
|
|
|
break;
|
|
|
}
|
...
|
...
|
@@ -59,7 +59,6 @@ class RecomController extends AbstractAction |
|
|
$data['goods'][] = Helpers::formatProduct($value, true);
|
|
|
}
|
|
|
$this->_view->display('maylike', $data);
|
|
|
|
|
|
} while (false);
|
|
|
|
|
|
echo ' ';
|
...
|
...
|
@@ -120,32 +119,65 @@ class RecomController extends AbstractAction |
|
|
if (!$this->isAjax()) {
|
|
|
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();
|
|
|
$build['show'] = 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;
|
|
|
}
|
|
|
$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;
|
|
|
$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);
|
...
|
...
|
|