...
|
...
|
@@ -46,14 +46,15 @@ class UserModel |
|
|
* 处理个人中心页面优惠券,收藏的商品等的数目数据
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @param int $udid 客户端唯一标识
|
|
|
* @return array|mixed 处理之后的个人中心页面优惠券,收藏的商品等的数目数据
|
|
|
*/
|
|
|
public static function getInfoNumData($uid)
|
|
|
public static function getInfoNumData($uid, $udid)
|
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
// 调用接口获取个人中心页面优惠券,收藏的商品等的数目数据
|
|
|
$infoNumData = UserData::infoNum($uid);
|
|
|
$infoNumData = UserData::infoNum($uid, $udid);
|
|
|
|
|
|
// 处理个人中心页面优惠券,收藏的商品等的数目数据
|
|
|
if (isset($infoNumData['data']) && !empty($infoNumData['data'])) {
|
...
|
...
|
@@ -181,9 +182,9 @@ class UserModel |
|
|
$product['imgUrl'] = Helpers::getImageUrl($val['image'], 447, 596);
|
|
|
;
|
|
|
$product['title'] = $val['product_name'];
|
|
|
$product['price'] = !empty($val['market_price']) ? '¥' . $val['market_price'] . '.00' : 0;
|
|
|
$product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . $val['sales_price'] . '.00' : false;
|
|
|
$product['savePrice'] = ($val['price_down'] > 0) ? '¥' . $val['price_down'] . '.00' : false;
|
|
|
$product['price'] = !empty($val['market_price']) ? '¥' . $val['market_price'] . '.00' : 0;
|
|
|
$product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . $val['sales_price'] . '.00' : false;
|
|
|
$product['savePrice'] = ($val['price_down'] > 0) ? '¥' . $val['price_down'] . '.00' : false;
|
|
|
$product['sellOut'] = ($val['storage'] <= 0);
|
|
|
|
|
|
$datas[] = $product;
|
...
|
...
|
@@ -236,7 +237,8 @@ class UserModel |
|
|
$product = array();
|
|
|
foreach ($val['new_product'] as $one) {
|
|
|
$product = array();
|
|
|
$product['imgUrl'] = Images::getImageUrl($one['default_images'], 235, 314);
|
|
|
$product['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
|
|
|
$product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : '';
|
|
|
$product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] . '.00' : 0;
|
|
|
$product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] . '.00' : 0;
|
|
|
|
...
|
...
|
@@ -299,9 +301,10 @@ class UserModel |
|
|
} else {
|
|
|
$data = $records['data']['product_list'];
|
|
|
foreach ($data as &$val) {
|
|
|
$val['image'] = Helpers::getImageUrl($val['image'], 140, 140);
|
|
|
$val['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
|
|
|
$val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 140, 140) : '';
|
|
|
$val['sales_price'] = !empty($val['sales_price']) ? $val['sales_price'] . '.00' : 0;
|
|
|
$val['market_price'] = !empty($val['market_price']) ? $val['market_price'] . '.00' : 0;
|
|
|
$val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false;
|
|
|
}
|
|
|
!empty($data) && $result['browseRecord'] = $data;
|
|
|
}
|
...
|
...
|
@@ -333,7 +336,7 @@ class UserModel |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 处理YOHO币数据
|
|
|
* 处理YOHO币总数数据
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @return array|mixed 处理之后的YOHO币数据
|
...
|
...
|
@@ -343,7 +346,7 @@ class UserModel |
|
|
$result = array();
|
|
|
|
|
|
// 调用接口获取YOHO币
|
|
|
$yohoCoin = UserData::yohoCoinData($uid);
|
|
|
$yohoCoin = UserData::yohoCoinTotal($uid);
|
|
|
|
|
|
// 处理YOHO币数据
|
|
|
if (isset($yohoCoin['data']) && !empty($yohoCoin['data'])) {
|
...
|
...
|
|