修改收藏的商品价格显示的问题;修改个人中心页面一些信息数目的获取接口
Showing
3 changed files
with
11 additions
and
7 deletions
@@ -21,6 +21,7 @@ class UserData | @@ -21,6 +21,7 @@ class UserData | ||
21 | * 个人详情数据 | 21 | * 个人详情数据 |
22 | * | 22 | * |
23 | * @param int $uid 用户ID | 23 | * @param int $uid 用户ID |
24 | + * @param int $udid 客户端唯一标识 | ||
24 | * @return array 个人详情接口返回的数据 | 25 | * @return array 个人详情接口返回的数据 |
25 | */ | 26 | */ |
26 | public static function userData($uid) | 27 | public static function userData($uid) |
@@ -39,11 +40,12 @@ class UserData | @@ -39,11 +40,12 @@ class UserData | ||
39 | * @param int $uid 用户ID | 40 | * @param int $uid 用户ID |
40 | * @return array 接口返回的数据 | 41 | * @return array 接口返回的数据 |
41 | */ | 42 | */ |
42 | - public static function infoNum($uid) | 43 | + public static function infoNum($uid, $udid) |
43 | { | 44 | { |
44 | $param = Yohobuy::param(); | 45 | $param = Yohobuy::param(); |
45 | $param['method'] = 'app.home.getInfoNum'; | 46 | $param['method'] = 'app.home.getInfoNum'; |
46 | $param['uid'] = $uid; | 47 | $param['uid'] = $uid; |
48 | + $param['udid'] = $udid; | ||
47 | $param['client_secret'] = Sign::getSign($param); | 49 | $param['client_secret'] = Sign::getSign($param); |
48 | 50 | ||
49 | return Yohobuy::get(Yohobuy::API_URL, $param); | 51 | return Yohobuy::get(Yohobuy::API_URL, $param); |
@@ -65,8 +65,9 @@ class HomeController extends AbstractAction | @@ -65,8 +65,9 @@ class HomeController extends AbstractAction | ||
65 | ); | 65 | ); |
66 | if ($this->_uid) { | 66 | if ($this->_uid) { |
67 | $data['isLogin'] = true; | 67 | $data['isLogin'] = true; |
68 | + $udid = $this->getUdid(); | ||
68 | $data += UserModel::getUserProfileData($this->_uid); | 69 | $data += UserModel::getUserProfileData($this->_uid); |
69 | - $data += UserModel::getInfoNumData($this->_uid); | 70 | + $data += UserModel::getInfoNumData($this->_uid, $udid); |
70 | 71 | ||
71 | // 优选新品数据 | 72 | // 优选新品数据 |
72 | $channel = Helpers::getChannelByCookie(); | 73 | $channel = Helpers::getChannelByCookie(); |
@@ -46,14 +46,15 @@ class UserModel | @@ -46,14 +46,15 @@ class UserModel | ||
46 | * 处理个人中心页面优惠券,收藏的商品等的数目数据 | 46 | * 处理个人中心页面优惠券,收藏的商品等的数目数据 |
47 | * | 47 | * |
48 | * @param int $uid 用户ID | 48 | * @param int $uid 用户ID |
49 | + * @param int $udid 客户端唯一标识 | ||
49 | * @return array|mixed 处理之后的个人中心页面优惠券,收藏的商品等的数目数据 | 50 | * @return array|mixed 处理之后的个人中心页面优惠券,收藏的商品等的数目数据 |
50 | */ | 51 | */ |
51 | - public static function getInfoNumData($uid) | 52 | + public static function getInfoNumData($uid, $udid) |
52 | { | 53 | { |
53 | $result = array(); | 54 | $result = array(); |
54 | 55 | ||
55 | // 调用接口获取个人中心页面优惠券,收藏的商品等的数目数据 | 56 | // 调用接口获取个人中心页面优惠券,收藏的商品等的数目数据 |
56 | - $infoNumData = UserData::infoNum($uid); | 57 | + $infoNumData = UserData::infoNum($uid, $udid); |
57 | 58 | ||
58 | // 处理个人中心页面优惠券,收藏的商品等的数目数据 | 59 | // 处理个人中心页面优惠券,收藏的商品等的数目数据 |
59 | if (isset($infoNumData['data']) && !empty($infoNumData['data'])) { | 60 | if (isset($infoNumData['data']) && !empty($infoNumData['data'])) { |
@@ -181,9 +182,9 @@ class UserModel | @@ -181,9 +182,9 @@ class UserModel | ||
181 | $product['imgUrl'] = Helpers::getImageUrl($val['image'], 447, 596); | 182 | $product['imgUrl'] = Helpers::getImageUrl($val['image'], 447, 596); |
182 | ; | 183 | ; |
183 | $product['title'] = $val['product_name']; | 184 | $product['title'] = $val['product_name']; |
184 | - $product['price'] = !empty($val['market_price']) ? '¥' . $val['market_price'] . '.00' : 0; | ||
185 | - $product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . $val['sales_price'] . '.00' : false; | ||
186 | - $product['savePrice'] = ($val['price_down'] > 0) ? '¥' . $val['price_down'] . '.00' : false; | 185 | + $product['price'] = !empty($val['market_price']) ? '¥' . $val['market_price'] . '.00' : 0; |
186 | + $product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . $val['sales_price'] . '.00' : false; | ||
187 | + $product['savePrice'] = ($val['price_down'] > 0) ? '¥' . $val['price_down'] . '.00' : false; | ||
187 | $product['sellOut'] = ($val['storage'] <= 0); | 188 | $product['sellOut'] = ($val['storage'] <= 0); |
188 | 189 | ||
189 | $datas[] = $product; | 190 | $datas[] = $product; |
-
Please register or login to post a comment