Authored by Rock Zhang

完善收藏的商品接口

... ... @@ -154,7 +154,7 @@ class UserData
public static function favoriteProductData($uid, $page = 1, $limit = 10)
{
$param = array();
$param['uid'] = $uid;
$param['uid'] = 3459464;
$param['page'] = $page;
$param['limit'] = $limit;
... ... @@ -173,7 +173,7 @@ class UserData
public static function favoriteBrandData($uid, $size, $page = 1, $limit = 10)
{
$param = array();
$param['uid'] = $uid;
$param['uid'] = 3459464;
$param['page'] = $page;
$param['size'] = $size;
$param['limit'] = $limit;
... ...
... ... @@ -194,12 +194,12 @@ class UserModel
$favProduct = UserData::favoriteProductData($uid);
// 处理用户收藏的商品数据
if (isset($favProduct['data']) && !empty($favProduct['data'])) {
if (isset($favProduct['list']) && !empty($favProduct['list'])) {
$product = array();
foreach ($favProduct['data']['product_list'] as $val) {
foreach ($favProduct['list'] as $val) {
$product = array();
$product['fav_id'] = $val['product_id'];
$product['imgUrl'] = $val['image'];
$product['imgUrl'] = Helpers::getImageUrl($val['image'], 140, 140);
$product['title'] = $val['product_name'];
$product['price'] = '¥'.$val['market_price'];
$product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥'.$val['sales_price'] : false;
... ... @@ -231,9 +231,9 @@ class UserModel
$favBrand = UserData::favoriteBrandData($uid, $size, $page, $limit);
// 处理用户收藏的品牌数据
if (isset($favBrand['data']) && !empty($favBrand['data'])) {
if (isset($favBrand['list']) && !empty($favBrand['list'])) {
$brand = array();
foreach ($favBrand['data']['brand_list'] as $val) {
foreach ($favBrand['list'] as $val) {
$brand = array();
$brand['id'] = $val['brand_id'];
$brand['brandImg'] = Images::getImageUrl($val['brand_ico'], 235, 314);
... ...