Authored by Rock Zhang

在获取商品介绍接口中加入uid和udid参数,为了实现记录浏览记录的功能

Code Review By Rock Zhang
... ... @@ -52,13 +52,20 @@ class DetailData
* 商品尺码信息
*
* @param int $productSkn 商品SKN号
* @param int $uid 用户ID
* @param int $udid 客户端唯一标识
* @return array
*/
public static function sizeInfo($productSkn)
public static function sizeInfo($productSkn, $uid, $udid)
{
$param = Yohobuy::param();
$param['method'] = 'h5.product.intro';
$param['productskn'] = $productSkn;
if (!empty($uid)) {
$param['uid'] = $uid;
}
$param['udid'] = $udid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
... ...
... ... @@ -335,15 +335,17 @@ class DetailModel
* 商品尺码信息
*
* @param int $productSkn
* @param int $uid 用户ID
* @param int $udid 客户端唯一标识
* @return array
*/
public static function getSizeInfo($productSkn)
public static function getSizeInfo($productSkn, $uid, $udid)
{
$result = array();
if (is_numeric($productSkn)) {
// 调用服务
$sizeInfo = DetailData::sizeInfo($productSkn);
$sizeInfo = DetailData::sizeInfo($productSkn, $uid, $udid);
// 商品信息
if (isset($sizeInfo['productDescBo']['erpProductId'])) {
... ...
... ... @@ -90,7 +90,11 @@ class DetailController extends AbstractAction
if (!is_numeric($productSkn)) {
echo ' ';
}
$data = \Product\DetailModel::getSizeInfo($productSkn);
// 加入uid和udid参数,为了实现记录浏览记录的功能
$uid = $this->getUid();
$udid = $this->getUdid();
$data = \Product\DetailModel::getSizeInfo($productSkn, $uid, $udid);
if (array() === $data) {
echo ' ';
exit();
... ...