...
|
...
|
@@ -30,7 +30,7 @@ class PlusstarController extends AbstractAction |
|
|
$data['psList'] = true; // 控制模板中的JS使用
|
|
|
$data['ps']['sName'] = '明星潮品';
|
|
|
$data['ps']['pName'] = '原创潮牌';
|
|
|
$data[ 'pageFooter'] = true;
|
|
|
$data['pageFooter'] = true;
|
|
|
|
|
|
$this->_view->display('list', $data);
|
|
|
} else {
|
...
|
...
|
@@ -41,7 +41,7 @@ class PlusstarController extends AbstractAction |
|
|
$data['psList'] = true; // 控制模板中的JS使用
|
|
|
$data['ps']['sName'] = '设计师';
|
|
|
$data['ps']['pName'] = '经典潮牌';
|
|
|
$data[ 'pageFooter'] = true;
|
|
|
$data['pageFooter'] = true;
|
|
|
|
|
|
$this->_view->display('list', $data);
|
|
|
}
|
...
|
...
|
@@ -75,30 +75,54 @@ class PlusstarController extends AbstractAction |
|
|
{
|
|
|
$data = array();
|
|
|
|
|
|
$id = $this->get('id');
|
|
|
$gender = $this->get('gender', '1,3');
|
|
|
$uid = $this->getUid();
|
|
|
$udid = $this->getUdid();
|
|
|
|
|
|
do {
|
|
|
/* 判断参数是否有效 */
|
|
|
if (!is_numeric($id) || ($gender !== '1,3' && $gender !== '2,3')) {
|
|
|
$id = $this->get('id');
|
|
|
if (!is_numeric($id)) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
$channel = $this->get('yh_channel');
|
|
|
// 标识是不是APP客户端
|
|
|
$isApp = is_numeric($channel);
|
|
|
// APP访问时通过频道参数判断性别
|
|
|
if ($isApp) {
|
|
|
switch (intval($channel)) {
|
|
|
case 1: // 男
|
|
|
$gender = '1,3';
|
|
|
break;
|
|
|
case 2: // 女
|
|
|
$gender = '2,3';
|
|
|
break;
|
|
|
default: // 所有
|
|
|
$gender = '1,2,3';
|
|
|
}
|
|
|
$uid = $this->get('uid');
|
|
|
$udid = $this->get('udid');
|
|
|
}
|
|
|
// 从Cookie获取
|
|
|
else {
|
|
|
$gender = Helpers::getGenderByCookie();
|
|
|
|
|
|
$uid = $this->getUid();
|
|
|
$udid = $this->getUdid();
|
|
|
}
|
|
|
|
|
|
/* 判断品牌信息是否为空 */
|
|
|
$brandInfo = PlusstarData::brandInfo($id, $gender, $uid, $udid);
|
|
|
$brandInfo = PlusstarData::brandInfo($id, $gender, $uid, $udid, $isApp);
|
|
|
if (empty($brandInfo['getBrandInfo']['data']['brand_id'])) {
|
|
|
break;
|
|
|
}
|
|
|
$brandId = $brandInfo['getBrandInfo']['data']['brand_id'];
|
|
|
$brandDomain = $brandInfo['getBrandInfo']['data']['brand_domain'];
|
|
|
$isDifferent = $brandInfo['getBrandInfo']['data']['is_different'];
|
|
|
|
|
|
/* 获取更多品牌的链接 */
|
|
|
$url = '/brands';
|
|
|
$brandDomains = Product\ListModel::getAllBrandDomains();
|
|
|
if (isset($brandDomains[$brandId])) {
|
|
|
// 构建成 品牌域名.xxx.com
|
|
|
$url = Helpers::url('', null, $brandDomains[$brandId]);
|
|
|
// 构建成 品牌域名.xxx.com
|
|
|
$url = Helpers::url('', null, $brandDomain);
|
|
|
// 备注:如果以后APP的接口太多,可以把这边参数提取出来,变成一个公共的方法来生成,便于以后管理维护
|
|
|
if ($isApp) {
|
|
|
$url .= '?openby:yohobuy={"action":"go.brand","params":{"brand_id":"' . $brandId . '","is_different":"' . $isDifferent . '"}}';
|
|
|
}
|
|
|
|
|
|
$data['psDetail'] = true;
|
...
|
...
|
@@ -107,12 +131,23 @@ class PlusstarController extends AbstractAction |
|
|
$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'] = 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'] = $url;
|
|
|
$data['ps']['newArrival']['naList'] = $brandInfo['getNewProduct'];
|
|
|
$data['ps']['infos'] = array();
|
|
|
|
|
|
// 拼收藏的URL, 一个坑!
|
|
|
// 备注:此处是根据原来逛的代码硬扒过来的
|
|
|
$defaultUrl = Helpers::url('/plustar/brandinfo', array('id' => $id), 'guang');
|
|
|
if ($isApp) {
|
|
|
$url = $defaultUrl;
|
|
|
$url .= '&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http:\/\/guang.m.yohobuy.com\/plustar\/brandinfo","param":{"id":'
|
|
|
. $id . '}},"requesturl":{"url":"\/guang\/api\/v1\/favorite\/togglebrand","param":{"brand_id":"' . $brandId . '"}},"priority":"Y"}}';
|
|
|
} else {
|
|
|
$url = Helpers::url('/signin.html', array('refer' => $defaultUrl));
|
|
|
}
|
|
|
$data['ps']['likeUrl'] = $url;
|
|
|
|
|
|
if (empty($brandInfo['getArticleByBrand'])) {
|
|
|
break;
|
...
|
...
|
@@ -120,11 +155,22 @@ class PlusstarController extends AbstractAction |
|
|
|
|
|
// 相关文章
|
|
|
foreach ($brandInfo['getArticleByBrand'] as $value) {
|
|
|
$data['ps']['infos'][] = Helpers::formatArticle($value, false, false, false);
|
|
|
$data['ps']['infos'][] = Helpers::formatArticle($value, false, false, false, $uid);
|
|
|
}
|
|
|
|
|
|
// 设置头部信息
|
|
|
if (!$isApp) {
|
|
|
$this->setNavHeader($data['ps']['name'], true, SITE_MAIN);
|
|
|
}
|
|
|
|
|
|
$this->setNavHeader($brandInfo['getBrandInfo']['data']['brand_name'], true, SITE_MAIN);
|
|
|
|
|
|
// 标识有微信分享
|
|
|
$data['hasWxShare'] = true;
|
|
|
|
|
|
$data['shareLink'] = $defaultUrl;
|
|
|
$data['shareTitle'] = $data['ps']['name'];
|
|
|
$data['shareDesc'] = (mb_strlen($data['ps']['intro'],'utf-8') > 800) ? mb_substr($data['ps']['intro'], 0, 800, 'utf-8') . '...' : $data['ps']['intro'];
|
|
|
$data['shareImg'] = $data['ps']['logo'];
|
|
|
|
|
|
$brandInfo = array();
|
|
|
|
|
|
} while (false);
|
...
|
...
|
@@ -134,7 +180,6 @@ class PlusstarController extends AbstractAction |
|
|
} else {
|
|
|
$this->_view->display('detail', $data);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
} |
...
|
...
|
|