Authored by Rock Zhang

修改收藏的商品价格显示的问题;修改个人中心页面一些信息数目的获取接口

... ... @@ -21,6 +21,7 @@ class UserData
* 个人详情数据
*
* @param int $uid 用户ID
* @param int $udid 客户端唯一标识
* @return array 个人详情接口返回的数据
*/
public static function userData($uid)
... ... @@ -39,11 +40,12 @@ class UserData
* @param int $uid 用户ID
* @return array 接口返回的数据
*/
public static function infoNum($uid)
public static function infoNum($uid, $udid)
{
$param = Yohobuy::param();
$param['method'] = 'app.home.getInfoNum';
$param['uid'] = $uid;
$param['udid'] = $udid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
... ...
... ... @@ -65,8 +65,9 @@ class HomeController extends AbstractAction
);
if ($this->_uid) {
$data['isLogin'] = true;
$udid = $this->getUdid();
$data += UserModel::getUserProfileData($this->_uid);
$data += UserModel::getInfoNumData($this->_uid);
$data += UserModel::getInfoNumData($this->_uid, $udid);
// 优选新品数据
$channel = Helpers::getChannelByCookie();
... ...
... ... @@ -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;
... ...