Authored by hf

fixes bug to home favorite show error

@@ -52,17 +52,17 @@ class UserModel @@ -52,17 +52,17 @@ class UserModel
52 public static function getInfoNumData($uid, $udid) 52 public static function getInfoNumData($uid, $udid)
53 { 53 {
54 $result = array( 54 $result = array(
55 - 'wait_pay_num' => 0,  
56 - 'wait_cargo_num' => 0,  
57 - 'send_cargo_num' => 0,  
58 - 'brand_favorite_total' => 0,  
59 - 'product_favorite_total' => 0,  
60 - 'inbox_total' => 0,  
61 - 'comment_total' => 0,  
62 - 'refund_exchange_num' => 0,  
63 - 'yoho_coin_num' => 0,  
64 - 'coupon_num' => 0,  
65 - 'product_browse' => 0 55 + 'wait_pay_num' => 0,
  56 + 'wait_cargo_num' => 0,
  57 + 'send_cargo_num' => 0,
  58 + 'brand_favorite_total' => 0,
  59 + 'product_favorite_total' => 0,
  60 + 'inbox_total' => 0,
  61 + 'comment_total' => 0,
  62 + 'refund_exchange_num' => 0,
  63 + 'yoho_coin_num' => 0,
  64 + 'coupon_num' => 0,
  65 + 'product_browse' => 0
66 ); 66 );
67 67
68 // 调用接口获取个人中心页面优惠券,收藏的商品等的数目数据 68 // 调用接口获取个人中心页面优惠券,收藏的商品等的数目数据
@@ -187,9 +187,9 @@ class UserModel @@ -187,9 +187,9 @@ class UserModel
187 $datas = array(); 187 $datas = array();
188 $product = array(); 188 $product = array();
189 foreach ($favProduct['data']['product_list'] as $val) { 189 foreach ($favProduct['data']['product_list'] as $val) {
190 - if (empty($val['product_skn'])) {  
191 - continue;  
192 - } 190 + if (empty($val['product_skn'])) {
  191 + continue;
  192 + }
193 193
194 $product = array(); 194 $product = array();
195 $product['fav_id'] = $val['product_id']; 195 $product['fav_id'] = $val['product_id'];
@@ -251,12 +251,12 @@ class UserModel @@ -251,12 +251,12 @@ class UserModel
251 // 处理品牌产品 251 // 处理品牌产品
252 $product = array(); 252 $product = array();
253 foreach ($val['new_product'] as $one) { 253 foreach ($val['new_product'] as $one) {
254 - if (empty($one['product_skn'])) {  
255 - continue;  
256 - } 254 + if (empty($one['product_skn'])) {
  255 + continue;
  256 + }
257 257
258 $product = array(); 258 $product = array();
259 - $product['link'] = isset($one['goods'][0], $one['cnAlphabet']) ? Helpers::url('/product/pro_' . $one['product_id'] . '_' . $one['goods'][0]['id'] . '/' . $one['cnAlphabet'] . '.html') : ''; 259 + $product['link'] = isset($one['goods'][0], $one['cnAlphabet']) ? Helpers::url('/product/pro_' . $one['product_id'] . '_' . $one['goods'][0]['id'] . '/' . $one['cnAlphabet'] . '.html') : '';
260 $product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : ''; 260 $product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : '';
261 $product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] : 0; 261 $product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] : 0;
262 $product['discount'] = ($one['market_price'] > $one['sales_price']) ? '¥' . $one['sales_price'] : false; 262 $product['discount'] = ($one['market_price'] > $one['sales_price']) ? '¥' . $one['sales_price'] : false;
@@ -320,7 +320,7 @@ class UserModel @@ -320,7 +320,7 @@ class UserModel
320 } else { 320 } else {
321 $data = $records['data']['product_list']; 321 $data = $records['data']['product_list'];
322 foreach ($data as &$val) { 322 foreach ($data as &$val) {
323 - $val['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : ''; 323 + $val['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
324 $val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : ''; 324 $val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : '';
325 $val['sales_price'] = (!empty($val['sales_price']) && !is_float($val['sales_price'])) ? $val['sales_price'] . '.00' : $val['sales_price']; 325 $val['sales_price'] = (!empty($val['sales_price']) && !is_float($val['sales_price'])) ? $val['sales_price'] . '.00' : $val['sales_price'];
326 $val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false; 326 $val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false;
@@ -761,14 +761,14 @@ class UserModel @@ -761,14 +761,14 @@ class UserModel
761 if (isset($helpListData['data']) && !empty($helpListData['data'])) { 761 if (isset($helpListData['data']) && !empty($helpListData['data'])) {
762 $help = $helpListData['data']; 762 $help = $helpListData['data'];
763 763
764 - $one = array();  
765 - foreach ($help as $val) {  
766 - $one = array();  
767 - $one['name'] = $val['caption'];  
768 - $one['url'] = Helpers::url('/home/helpdetail/', array('code' => $val['code'])); 764 + $one = array();
  765 + foreach ($help as $val) {
  766 + $one = array();
  767 + $one['name'] = $val['caption'];
  768 + $one['url'] = Helpers::url('/home/helpdetail/', array('code' => $val['code']));
769 769
770 - $result['iHelp'][] = $one;  
771 - } 770 + $result['iHelp'][] = $one;
  771 + }
772 } 772 }
773 773
774 return $result; 774 return $result;