Authored by hf

modify to fixes product price add .00

... ... @@ -201,7 +201,7 @@ class Helpers
$result['product_id'] = $productData['product_id'];
$result['thumb'] = Images::getImageUrl($productData['default_images'], $width, $height);
$result['name'] = $productData['product_name'];
$result['price'] = $productData['market_price'] . '.00';
$result['price'] = empty($productData['market_price']) ? false : $productData['market_price'] . '.00';
$result['salePrice'] = $productData['sales_price'] . '.00';
$result['is_soon_sold_out'] = ($productData['is_soon_sold_out'] === 'Y');
$result['url'] = SITE_MAIN . '/product/pro_' . $productData['product_id'] . '_'
... ...
... ... @@ -58,13 +58,13 @@ class RecomController extends AbstractAction
foreach ($recom['data']['product_list'] as $value) {
$data['goods'][] = Helpers::formatProduct($value, true, true, true, 276, 366);
}
$this->_view->display('maylike', $data);
exit();
} while (false);
echo ' ';
if (isset($data)) {
$this->_view->display('maylike', $data);
} else {
echo ' ';
}
}
/**
... ... @@ -103,12 +103,13 @@ class RecomController extends AbstractAction
foreach ($recom['data']['product_list'] as $value) {
$data['goods'][] = Helpers::formatProduct($value, true);
}
$this->_view->display('maylike', $data);
exit();
} while (false);
echo ' ';
if (isset($data)) {
$this->_view->display('maylike', $data);
} else {
echo ' ';
}
}
/**
... ... @@ -123,23 +124,22 @@ class RecomController extends AbstractAction
if (!$this->isAjax()) {
break;
}
/* 创意生活只有一页数据 */
$page = $this->get('page', 1);
if (intval($page) > 1) {
break;
}
}
/* 取可能喜欢的数据 */
$recom = RecomData::mayLikeLifestyle();
/* 构建人气单品数据 */
if (empty($recom['top']['data']['product_list'])) {
break;
}
$data = array();
$build = array();
$build['show'] = true;
foreach ($recom['top']['data']['product_list'] as $value) {
... ... @@ -181,13 +181,13 @@ class RecomController extends AbstractAction
// }
// $data['goodsContainer'][] = $build;
// }
$this->_view->display('maylikelife', $data);
exit();
} while (false);
echo ' ';
if (isset($data)) {
$this->_view->display('maylikelife', $data);
} else {
echo ' ';
}
}
}
... ...