Authored by hf

fixes bug to guang detail page brand link click

... ... @@ -17,16 +17,16 @@ use Plugin\Cache;
class Yohobuy
{
/* 正式环境 */
const API_URL = 'http://api2.open.yohobuy.com/';
const SERVICE_URL = 'http://service.api.yohobuy.com/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
// /* 测试环境 */
// const API_URL = 'http://test2.open.yohobuy.com/';
// const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
// /* 正式环境 */
// const API_URL = 'http://api2.open.yohobuy.com/';
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
/* 测试环境 */
const API_URL = 'http://test2.open.yohobuy.com/';
const SERVICE_URL = 'http://test.service.api.yohobuy.com/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
/**
* 私钥列表
*
... ...
{
"name": "yohobuy",
"version": "0.0.2",
"version": "0.0.3",
"description": "yohobuy statics",
"keywords": [],
"homepage": "",
... ...
... ... @@ -73,7 +73,6 @@ class SearchController extends AbstractAction
'discount' => FILTER_VALIDATE_INT,
'gender' => FILTER_DEFAULT,
'p_d' => FILTER_DEFAULT,), false);
$query = isset($condition['query']) ? strtolower(trim($condition['query'])) : null;
// 标识用户是否有输入搜索内容
... ... @@ -234,14 +233,15 @@ class SearchController extends AbstractAction
}
$data = array();
// 查询数据
// 查询品类数据
if (!isset($condition['query'])) {
$data += Product\ListModel::getClassData($condition);
$data += Product\ListModel::getClassData($condition, $order, $page);
if (isset($data['filter'])) {
unset($data['filter']);
}
} else {
}
// 查询数据
else {
$listData = SearchData::searchByCondition($condition, $order, $page);
// 处理返回的数据
if (isset($listData['data'])) {
... ...
... ... @@ -150,7 +150,7 @@ class PlusstarModel
if (isset($value['data'][1])) {
$imgs = array();
foreach ($value['data'] as $ps) {
$build['url'] = '/guang/plusstar/detail?id=' . $value['id'] . '&gender=' . $gender;
$build['url'] = Helpers::url('/plustar/brandinfo', array('id' => $value['id'], 'gender' => $gender), 'guang');
$build['img'] = Helpers::getImageUrl($ps['src'], 640, 310);
$build['deps'] = $showSummary ? $value['brand_title'] : false;
$imgs[] = $build;
... ... @@ -159,7 +159,7 @@ class PlusstarModel
}
// 情况2: 单张图
elseif (isset($value['data'][0])) {
$build['url'] = '/guang/plusstar/detail?id=' . $value['id'] . '&gender=' . $gender;
$build['url'] = Helpers::url('/plustar/brandinfo', array('id' => $value['id'], 'gender' => $gender), 'guang');
$build['img'] = Helpers::getImageUrl($value['data'][0]['src'], 640, 310);
$build['deps'] = $showSummary ? $value['brand_title'] : false;
$result[] = $build;
... ...
... ... @@ -82,9 +82,18 @@ class PlusstarController extends AbstractAction
if (empty($brandInfo['getBrandInfo']['data']['brand_id'])) {
break;
}
$brandId = $brandInfo['getBrandInfo']['data']['brand_id'];
/* 获取更多品牌的链接 */
$url = '/brands';
$brandDomains = Product\ListModel::getAllBrandDomains();
if (isset($brandDomains[$brandId])) {
// 构建成 品牌域名.xxx.com
$url = Helpers::url('', null, $brandDomains[$brandId]);
}
$data['psDetail'] = true;
$data['ps']['id'] = $brandInfo['getBrandInfo']['data']['brand_id'];
$data['ps']['id'] = $brandId;
$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'];
... ... @@ -92,7 +101,7 @@ class PlusstarController extends AbstractAction
$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'] = '/product/list/brand?brand=' . $id; // @todo 品牌列表页面
$data['ps']['newArrival']['moreUrl'] = $url;
$data['ps']['newArrival']['naList'] = $brandInfo['getNewProduct'];
$data['ps']['infos'] = array();
... ...
... ... @@ -50,4 +50,4 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets"
; 应用的版本号
application.version = "0.0.2"
\ No newline at end of file
application.version = "0.0.3"
\ No newline at end of file
... ...
... ... @@ -50,4 +50,4 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets"
; 应用的版本号
application.version = "0.0.2"
\ No newline at end of file
application.version = "0.0.3"
\ No newline at end of file
... ...
... ... @@ -50,4 +50,4 @@ application.template.ext = ".phtml"
application.assets.path = ROOT_PATH "/assets"
; 应用的版本号
application.version = "0.0.2"
\ No newline at end of file
application.version = "0.0.3"
\ No newline at end of file
... ...
... ... @@ -12,17 +12,17 @@ routes.author.route.module = Guang
routes.author.route.controller = Index
routes.author.route.action = Editor
; 国际优选
routes.author.type = "rewrite"
routes.author.match = "/plustar"
routes.author.route.module = Guang
routes.author.route.controller = Plusstar
routes.author.route.action = Index
; 国际优选/明星原创
routes.plusstar.type = "rewrite"
routes.plusstar.match = "/(plustar|plustar/index)$"
routes.plusstar.route.module = Guang
routes.plusstar.route.controller = Plusstar
routes.plusstar.route.action = Index
; 明星原创
routes.author.type = "rewrite"
routes.author.match = "/(plustar|plustar/index)"
routes.author.route.module = Guang
routes.author.route.controller = Plusstar
routes.author.route.action = Index
; 国际优选/明星原创详情
routes.brandinfo.type = "rewrite"
routes.brandinfo.match = "/(plustar/brandinfo)$"
routes.brandinfo.route.module = Guang
routes.brandinfo.route.controller = Plusstar
routes.brandinfo.route.action = detail
... ...