...
|
...
|
@@ -72,22 +72,23 @@ class PlusstarData |
|
|
*/
|
|
|
public static function brandInfo($id, $gender, $uid, $udid = null)
|
|
|
{
|
|
|
$isUidOk = $uid && is_numeric($uid);
|
|
|
|
|
|
// 品牌详情信息
|
|
|
$result = array();
|
|
|
$result['getBrandInfo'] = Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v1/plustar/', 'getBrandInfo', array(array('id' => $id)) );
|
|
|
$result['getBrandInfo'] = array();
|
|
|
$result['getUidBrandFav'] = false;
|
|
|
$result['getNewProduct'] = array();
|
|
|
$result['getUidProductFav'] = array();
|
|
|
$result['getArticleByBrand'] = array();
|
|
|
|
|
|
// 判断
|
|
|
if (!isset($result['getBrandInfo']['brand_id'])) {
|
|
|
// 品牌详情信息
|
|
|
$brandInfo = Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v1/plustar/', 'getBrandInfo', array(array('id' => $id)) );
|
|
|
if (!isset($brandInfo['brand_id'])) {
|
|
|
return $result;
|
|
|
} else {
|
|
|
$result['getBrandInfo'] = $brandInfo;
|
|
|
}
|
|
|
|
|
|
// 是否收藏店铺
|
|
|
$isUidOk = $uid && is_numeric($uid);
|
|
|
if ($isUidOk) {
|
|
|
Yohobuy::yarConcurrentCall(Yohobuy::SERVICE_URL . 'shops/service/v1/favorite/', 'getUidBrandFav', array($uid, $id), function($retval) use(&$result) {
|
|
|
$result['getUidBrandFav'] = empty($retval['data']) ? false : $retval['data'];
|
...
|
...
|
@@ -96,7 +97,7 @@ class PlusstarData |
|
|
|
|
|
// 相关资讯列表 (3篇)
|
|
|
$result['getArticleByBrand'] = array();
|
|
|
Yohobuy::yarConcurrentCall(Yohobuy::SERVICE_URL . 'guang/service/v1/article/', 'getArticleByBrand', array($result['getBrandInfo']['brand_id'], 3, $udid), function($retval) use(&$result) {
|
|
|
Yohobuy::yarConcurrentCall(Yohobuy::SERVICE_URL . 'guang/service/v1/article/', 'getArticleByBrand', array($brandInfo['brand_id'], 3, $udid), function($retval) use(&$result) {
|
|
|
$result['getArticleByBrand'] = empty($retval) ? array() : $retval;
|
|
|
});
|
|
|
|
...
|
...
|
@@ -108,7 +109,7 @@ class PlusstarData |
|
|
// 调用搜索接口
|
|
|
$param = Yohobuy::param();
|
|
|
$param['method'] = 'app.search.li';
|
|
|
$param['brand'] = $result['getBrandInfo']['brand_id'];
|
|
|
$param['brand'] = $brandInfo['brand_id'];
|
|
|
$param['page'] = '0';
|
|
|
$param['limit'] = '6';
|
|
|
$param['gender'] = $gender;
|
...
|
...
|
@@ -204,51 +205,4 @@ class PlusstarData |
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 品牌收藏/取消收藏
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @param int $id 唯一的ID
|
|
|
* @param string $opt 操作(ok:表示确定,cancel:表示取消)
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function favoriteBrand($uid, $id, $opt = 'ok')
|
|
|
{
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'shops/service/v1/favorite/', 'toggleBrandFav', array($uid, $id));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 商品收藏/取消收藏
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @param int $skn 商品标识
|
|
|
* @param string $opt 操作(ok:表示确定,cancel:表示取消)
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function favoriteProduct($uid, $skn, $opt = 'ok')
|
|
|
{
|
|
|
if ($opt === 'cancel') {
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'shops/service/v1/favorite/', 'addUidProductFav', array($uid, $skn));
|
|
|
} else {
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'shops/service/v1/favorite/', 'delUidProductFav', array($uid, $skn));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 资讯点赞/取消赞
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @param int $id 唯一的ID
|
|
|
* @param string $opt 操作(ok:表示确定,cancel:表示取消)
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function praiseArticle($uid, $id, $opt = 'ok')
|
|
|
{
|
|
|
if ($opt === 'cancel') {
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v1/favorite/', 'cancelPraise', array($id, $uid));
|
|
|
} else {
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v1/favorite/', 'setPraise', array($id, $uid));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|