...
|
...
|
@@ -42,7 +42,7 @@ class PlusstarController extends AbstractAction |
|
|
// 情况1: 多张图
|
|
|
if (isset($star['data'][1])) {
|
|
|
foreach ($star['data'] as $value) {
|
|
|
$build['url'] = $value['url'];
|
|
|
$build['url'] = '/guang/plusstar/detail?id=' . $star['id'] . '&gender='.$gender;
|
|
|
$build['img'] = Helpers::getImageUrl($value['src'], 640, 310);
|
|
|
$imgs[] = $build;
|
|
|
}
|
...
|
...
|
@@ -50,7 +50,7 @@ class PlusstarController extends AbstractAction |
|
|
}
|
|
|
// 情况2: 单张图
|
|
|
elseif (isset($star['data'][0])) {
|
|
|
$build['url'] = $star['data'][0]['url'];
|
|
|
$build['url'] = '/guang/plusstar/detail?id=' . $star['id'] . '&gender='.$gender;
|
|
|
$build['img'] = Helpers::getImageUrl($star['data'][0]['src'], 640, 310);
|
|
|
$data['ps']['star'][] = $build;
|
|
|
}
|
...
|
...
|
@@ -66,7 +66,7 @@ class PlusstarController extends AbstractAction |
|
|
// 情况1: 多张图
|
|
|
if (isset($original['data'][1])) {
|
|
|
foreach ($original['data'] as $value) {
|
|
|
$build['url'] = $value['url'];
|
|
|
$build['url'] = '/guang/plusstar/detail?id=' . $original['id'] . '&gender='.$gender;
|
|
|
$build['img'] = Helpers::getImageUrl($value['src'], 640, 310);
|
|
|
$build['deps'] = $original['brand_title'];
|
|
|
$imgs[] = $build;
|
...
|
...
|
@@ -75,7 +75,7 @@ class PlusstarController extends AbstractAction |
|
|
}
|
|
|
// 情况2: 单张图
|
|
|
elseif (isset($original['data'][0])) {
|
|
|
$build['url'] = $original['data'][0]['url'];
|
|
|
$build['url'] = '/guang/plusstar/detail?id=' . $original['id'] . '&gender='.$gender;
|
|
|
$build['img'] = Helpers::getImageUrl($original['data'][0]['src'], 640, 310);
|
|
|
$build['deps'] = $original['brand_title'];
|
|
|
$data['ps']['plus'][] = $build;
|
...
|
...
|
@@ -98,8 +98,8 @@ class PlusstarController extends AbstractAction |
|
|
|
|
|
$id = $this->get('id');
|
|
|
$gender = $this->get('gender', '1,3');
|
|
|
$uid = 0; // @todo
|
|
|
$udid = null; // @todo
|
|
|
$uid = $this->getUid();
|
|
|
$udid = $this->getUdid();
|
|
|
|
|
|
do {
|
|
|
/* 判断参数是否有效 */
|
...
|
...
|
@@ -109,46 +109,30 @@ class PlusstarController extends AbstractAction |
|
|
|
|
|
/* 判断品牌信息是否为空 */
|
|
|
$brandInfo = PlusstarData::brandInfo($id, $gender, $uid, $udid);
|
|
|
if (empty($brandInfo['getBrandInfo']['brand_id'])) {
|
|
|
if (empty($brandInfo['getBrandInfo']['data']['brand_id'])) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
$data['psDetail'] = true;
|
|
|
$data['ps']['id'] = $brandInfo['getBrandInfo']['brand_id'];
|
|
|
$data['ps']['banner'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['cover_img'], 640, 309);
|
|
|
$data['ps']['logo'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['brand_ico'], 160, 160);
|
|
|
$data['ps']['name'] = $brandInfo['getBrandInfo']['brand_name'];
|
|
|
$data['ps']['id'] = $brandInfo['getBrandInfo']['data']['brand_id'];
|
|
|
$data['ps']['banner'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['data']['cover_img'], 640, 309);
|
|
|
$data['ps']['logo'] = Helpers::getImageUrl($brandInfo['getBrandInfo']['data']['brand_ico'], 160, 160);
|
|
|
$data['ps']['name'] = $brandInfo['getBrandInfo']['data']['brand_name'];
|
|
|
$data['ps']['isLike'] = $brandInfo['getUidBrandFav'];
|
|
|
$data['ps']['likeUrl'] = "http://guang.m.yohobuy.com/plustar/brandinfo?id=285&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo","param":{"id":285}},"requesturl":{"url":"\/guang\/api\/v1\/favorite\/togglebrand","param":{"brand_id":"701"}},"priority":"Y"}}";
|
|
|
$data['ps']['intro'] = empty($brandInfo['getBrandInfo']['brand_intro']) ? '' : strtr(strip_tags($brandInfo['getBrandInfo']['brand_intro']), 'nbsp;', ' ');
|
|
|
$data['ps']['likeUrl'] = false; //"http://guang.m.yohobuy.com/plustar/brandinfo?id=285&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo","param":{"id":285}},"requesturl":{"url":"\/guang\/api\/v1\/favorite\/togglebrand","param":{"brand_id":"701"}},"priority":"Y"}}";
|
|
|
$data['ps']['intro'] = empty($brandInfo['getBrandInfo']['data']['brand_intro']) ? '' : strtr(strip_tags($brandInfo['getBrandInfo']['data']['brand_intro']), array(' ' => ' ') );
|
|
|
$data['ps']['newArrival'] = array();
|
|
|
$data['ps']['newArrival']['moreUrl'] = ''; // @todo
|
|
|
$data['ps']['newArrival']['moreUrl'] = ''; // @todo 品牌列表页面
|
|
|
$data['ps']['newArrival']['naList'] = $brandInfo['getNewProduct'];
|
|
|
$data['ps']['infos'] = array();
|
|
|
|
|
|
if (empty($brandInfo['getArticleByBrand'])) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
|
|
|
// 相关文章
|
|
|
$build = array();
|
|
|
foreach ($brandInfo['getArticleByBrand'] as $value) {
|
|
|
$build = array();
|
|
|
$build['id'] = $value['id'];
|
|
|
$build['showTags'] = false; // 不显示标签
|
|
|
$build['img'] = Helpers::getImageUrl($value['src'], 640, 640, $value['cover_image_type']);
|
|
|
$build['url'] = $value['url']; // @todo
|
|
|
$build['title'] = $value['title'];
|
|
|
$build['text'] = $value['intro'];
|
|
|
$build['publishTime'] = $value['publish_time'];
|
|
|
$build['pageView'] = $value['views_num'];
|
|
|
$build['like'] = array();
|
|
|
$build['like']['isLiked'] = $value['like']['isLiked'];
|
|
|
$build['like']['count'] = $value['like']['count'];
|
|
|
$build['share'] = ''; //分享链接
|
|
|
$build['author'] = false; // 作者信息(接口暂未上线)
|
|
|
|
|
|
$data['ps']['infos'][] = $build;
|
|
|
$data['ps']['infos'][] = Helpers::formatArticle($value, false, false, false);
|
|
|
}
|
|
|
|
|
|
$brandInfo = array();
|
...
|
...
|
|