...
|
...
|
@@ -33,7 +33,7 @@ class UserModel |
|
|
$userData = UserData::userData($uid);
|
|
|
|
|
|
// 处理个人详情数
|
|
|
if ($userData) {
|
|
|
if (!isset($userData['code'])) {
|
|
|
$result = $userData;
|
|
|
$result['gender'] = $result['gender'] == 1 ? '男' : '女';
|
|
|
$result['head_ico'] = $result['head_ico'] ? Images::getImageUrl($result['head_ico'], 128, 128) : '';
|
...
|
...
|
@@ -82,11 +82,30 @@ class UserModel |
|
|
$result = array();
|
|
|
|
|
|
// 用户优惠券数量
|
|
|
$couponNum = UserData::couponNum($uid) ?: 0;
|
|
|
$couponNum = UserData::couponNum($uid);
|
|
|
if(!isset($couponNum['code'])) {
|
|
|
$result['coupon_num'] = $couponNum;
|
|
|
}
|
|
|
// 用户收藏的品牌数量
|
|
|
$favBrandNum = UserData::favoriteBrandNum($uid) ?: 0;
|
|
|
$favBrandNum = UserData::favoriteBrandNum($uid);
|
|
|
if(!isset($favBrandNum['code'])) {
|
|
|
$result['brand_favorite_total'] = $favBrandNum;
|
|
|
}
|
|
|
// 用户收藏的商品数量
|
|
|
$favProductNum = UserData::favoriteProductNum($uid) ?: 0;
|
|
|
$favProductNum = UserData::favoriteProductNum($uid);
|
|
|
if(!isset($favProductNum['code'])) {
|
|
|
$result['product_favorite_total'] = $favProductNum;
|
|
|
}
|
|
|
// 未读消息数目
|
|
|
$messageNum = UserData::messageNum($uid);
|
|
|
if(!isset($messageNum['code'])) {
|
|
|
$result['inbox_total'] = $messageNum;
|
|
|
}
|
|
|
// 有货币数量
|
|
|
$coinNum = UserData::yohoCoinData($uid);
|
|
|
if(!isset($coinNum['code'])) {
|
|
|
$result['yoho_coin_num'] = $coinNum;
|
|
|
}
|
|
|
|
|
|
return $result;
|
|
|
}
|
...
|
...
|
@@ -199,15 +218,17 @@ class UserModel |
|
|
* 处理用户收藏的品牌数据
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @param string $gender 性别 1,3表示男,2,3表示女,1,2,3表示全部
|
|
|
* @param int $size 每页条数,size会覆盖limit值
|
|
|
* @param int $page 第几页,默认1
|
|
|
* @param int $limit 限制读取的数目,默认10
|
|
|
* @return array|mixed 处理之后的收藏的品牌数据
|
|
|
*/
|
|
|
public static function getFavBrandData($uid, $gender)
|
|
|
public static function getFavBrandData($uid, $size, $page, $limit)
|
|
|
{
|
|
|
$result = array();
|
|
|
|
|
|
// 调用接口获取户收藏的品牌数据
|
|
|
$favBrand = UserData::favoriteBrandData($uid, $gender);
|
|
|
$favBrand = UserData::favoriteBrandData($uid, $size, $page, $limit);
|
|
|
|
|
|
// 处理用户收藏的品牌数据
|
|
|
if (isset($favBrand['data']) && !empty($favBrand['data'])) {
|
...
|
...
|
|