Authored by Rock Zhang

完善收藏的商品接口

@@ -154,7 +154,7 @@ class UserData @@ -154,7 +154,7 @@ class UserData
154 public static function favoriteProductData($uid, $page = 1, $limit = 10) 154 public static function favoriteProductData($uid, $page = 1, $limit = 10)
155 { 155 {
156 $param = array(); 156 $param = array();
157 - $param['uid'] = $uid; 157 + $param['uid'] = 3459464;
158 $param['page'] = $page; 158 $param['page'] = $page;
159 $param['limit'] = $limit; 159 $param['limit'] = $limit;
160 160
@@ -173,7 +173,7 @@ class UserData @@ -173,7 +173,7 @@ class UserData
173 public static function favoriteBrandData($uid, $size, $page = 1, $limit = 10) 173 public static function favoriteBrandData($uid, $size, $page = 1, $limit = 10)
174 { 174 {
175 $param = array(); 175 $param = array();
176 - $param['uid'] = $uid; 176 + $param['uid'] = 3459464;
177 $param['page'] = $page; 177 $param['page'] = $page;
178 $param['size'] = $size; 178 $param['size'] = $size;
179 $param['limit'] = $limit; 179 $param['limit'] = $limit;
@@ -194,12 +194,12 @@ class UserModel @@ -194,12 +194,12 @@ class UserModel
194 $favProduct = UserData::favoriteProductData($uid); 194 $favProduct = UserData::favoriteProductData($uid);
195 195
196 // 处理用户收藏的商品数据 196 // 处理用户收藏的商品数据
197 - if (isset($favProduct['data']) && !empty($favProduct['data'])) { 197 + if (isset($favProduct['list']) && !empty($favProduct['list'])) {
198 $product = array(); 198 $product = array();
199 - foreach ($favProduct['data']['product_list'] as $val) { 199 + foreach ($favProduct['list'] as $val) {
200 $product = array(); 200 $product = array();
201 $product['fav_id'] = $val['product_id']; 201 $product['fav_id'] = $val['product_id'];
202 - $product['imgUrl'] = $val['image']; 202 + $product['imgUrl'] = Helpers::getImageUrl($val['image'], 140, 140);
203 $product['title'] = $val['product_name']; 203 $product['title'] = $val['product_name'];
204 $product['price'] = '¥'.$val['market_price']; 204 $product['price'] = '¥'.$val['market_price'];
205 $product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥'.$val['sales_price'] : false; 205 $product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥'.$val['sales_price'] : false;
@@ -231,9 +231,9 @@ class UserModel @@ -231,9 +231,9 @@ class UserModel
231 $favBrand = UserData::favoriteBrandData($uid, $size, $page, $limit); 231 $favBrand = UserData::favoriteBrandData($uid, $size, $page, $limit);
232 232
233 // 处理用户收藏的品牌数据 233 // 处理用户收藏的品牌数据
234 - if (isset($favBrand['data']) && !empty($favBrand['data'])) { 234 + if (isset($favBrand['list']) && !empty($favBrand['list'])) {
235 $brand = array(); 235 $brand = array();
236 - foreach ($favBrand['data']['brand_list'] as $val) { 236 + foreach ($favBrand['list'] as $val) {
237 $brand = array(); 237 $brand = array();
238 $brand['id'] = $val['brand_id']; 238 $brand['id'] = $val['brand_id'];
239 $brand['brandImg'] = Images::getImageUrl($val['brand_ico'], 235, 314); 239 $brand['brandImg'] = Images::getImageUrl($val['brand_ico'], 235, 314);