Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
yangyang
9 years ago
Commit
7d703b283e254d2ff3fb0ed04774d48a2149dccf
1 parent
4dff25ca
修改品牌数据分类信息,修改分类列表返回数据格式
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
27 deletions
library/LibModels/Web/Product/BrandData.php
library/LibModels/Web/Product/SearchData.php
yohobuy/www.yohobuy.com/application/models/Product/Brands.php
yohobuy/www.yohobuy.com/application/models/Product/Search.php
library/LibModels/Web/Product/BrandData.php
View file @
7d703b2
...
...
@@ -21,11 +21,11 @@ class BrandData
const
URL_BRAND_LOGO
=
'/shops/service/v1/brand'
;
/**
* 获取品牌
介绍
* 获取品牌
简介
*
* @param integer $brandId 品牌ID
* @param int 用户ID
* @return array 品牌介绍信息
* @param int 用户ID
* @return array 品牌介绍信息
*/
public
static
function
getBrandIntro
(
$brandId
,
$uid
)
{
...
...
@@ -42,9 +42,9 @@ class BrandData
}
/**
* 获取品牌banner
数据
* 获取品牌banner
图
* @param integer $brandId 品牌ID
* @return array banner
数据
* @return array banner
图
*/
public
static
function
getBrandBanner
(
$brandId
)
{
...
...
@@ -58,14 +58,14 @@ class BrandData
}
/**
* 获取品牌介绍
信息
* 获取品牌介绍
详情
*
* @param int $id 品牌id
* @return array
*/
public
static
function
getBrandLogo
(
$id
)
{
return
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URL_BRAND_LOGO
,
'getBrandByids'
,
array
(
$id
));
public
static
function
getBrandLogo
(
$brandId
)
{
return
Yohobuy
::
yarClient
(
Yohobuy
::
SERVICE_URL
.
self
::
URL_BRAND_LOGO
,
'getBrandByids'
,
array
(
$brandId
));
}
/**
...
...
library/LibModels/Web/Product/SearchData.php
View file @
7d703b2
...
...
@@ -68,14 +68,48 @@ class SearchData extends \LibModels\Wap\Product\SearchData
}
/**
* 获取品类数据
*
* @return array 品类数据
* 根据查询条件查询品类列表
*
* @param string $query 关键字
* @param bool $needAllSort 为1时返回全部分类
* @param bool needSmallSort 为1时返回小分类
* @param string $brand 品牌,查多个品牌以逗号分隔
* @param string $mosort 产品产品大分类ID,查多个大类以逗号分隔
* @param string $misort 产品产品中分类ID,查多个中类以逗号分隔
* @param string $sort 产品产品小分类ID,查多个小类以逗号分隔
* @param string $gender 性别,默认为null,"1"表示男, "2"表示女, "3"表示通用
* @param integer $color 颜色id
* @param integer $size 尺码id
* @param integer $price 价格
* @param integer $style 风格ID
* @param integer $parameter_xxx 属性类型ID与值ID 参数名称格式:parameter_{属性类型ID}={属性值ID},如查询厚度为中“parameter_875=4801”
* @param integer $stocknumber 库存量
* @param integer $shelve_time 时间区间
* @param integer $specialoffer 特价类型
* @param bool $sales 是否销售
* @param bool $promotion 是否为促销品
* @param integer $vdt 是否为促销品
* @param bool $vdt 折扣类型
* @param integer $p_d 促销浮点值
* @param integer $attribute 商品属性 1正常商品 2赠品
* @param integer $limited 是否限量 “N”或“Y”
* @param integer $new 是否新品 “N”或“Y”
* @param integer $status 是否上架
* @param integer $sell_channels 销售平台
* @param integer $p_d_int 促销折扣 int型如7
* @param integer $act_temp 活动模板
* @param integer $act_rec 活动模板是否推荐
* @param integer $act_status 活动模板商品状态
* @param integer $attribute_not 过滤商品属性,attribute_not=2过滤掉赠品
* @param integer $not_* not_字段名,过滤字段
* @return array 搜索到的数据
*/
public
static
function
getClassesData
(
$c
ondition
=
array
(),
$cache
=
false
)
public
static
function
getClassesData
(
$c
lasses
=
array
(),
$cache
=
false
)
{
$param
[
'brand'
]
=
$condition
;
return
Yohobuy
::
get
(
self
::
getUrl
(
'sort'
),
$param
,
$cache
);
$classes
[
'sales'
]
=
'Y'
;
//在销售商品分类
$classes
[
'status'
]
=
1
;
//上架商品分类
$classes
[
'stocknumber'
]
=
1
;
//过滤掉已售罄
return
Yohobuy
::
get
(
self
::
getUrl
(
'sort'
),
$classes
,
$cache
);
}
/**
...
...
yohobuy/www.yohobuy.com/application/models/Product/Brands.php
View file @
7d703b2
...
...
@@ -14,7 +14,8 @@ class BrandsModel
{
const
URL_BRAND_INDEX
=
'/product/brands/index'
;
public
static
$shopName
;
/**
* 获取品牌首页banner条
* @string $domain 品牌域名
...
...
@@ -53,7 +54,7 @@ class BrandsModel
// 获取品牌logo
$logo
=
Helpers
::
getImageUrl
(
$intro
[
'data'
][
'brand_ico'
],
80
,
50
);
// 获取品牌名
$shopName
=
$intro
[
'data'
][
'brand_name'
];
self
::
$shopName
=
$intro
[
'data'
][
'brand_name'
];
}
while
(
false
);
// 返回banner数据
...
...
@@ -67,7 +68,7 @@ class BrandsModel
'shopEntry'
=>
array
(
'home'
=>
$home
,
'logo'
=>
$logo
,
'shopName'
=>
$shopName
,
'shopName'
=>
self
::
$shopName
,
'sort'
=>
array
(
array
(
'href'
=>
''
,
...
...
@@ -93,9 +94,26 @@ class BrandsModel
*/
public
static
function
getBrandSearchData
(
$condition
,
$options
)
{
//配置调用分类接口参数
$classes
=
array
();
$classes
[
'brand'
]
=
$condition
[
'brand'
];
// 调用商品搜索接口
$data
=
\Product\SearchModel
::
getSearchData
(
$condition
,
$options
);
$data
=
\Product\SearchModel
::
getSearchData
(
$condition
,
$options
,
$classes
);
$shopName
=
self
::
$shopName
;
if
(
isset
(
$data
[
'list'
])){
$arr
=
array_chunk
(
$data
[
'list'
][
'pathNav'
],
1
);
$arr
[
0
][]
=
Array
(
'name'
=>
$shopName
);
}
$nav
=
array_merge_recursive
(
$arr
[
0
],
$arr
[
1
]);
$data
[
'list'
][
'pathNav'
]
=
$nav
;
//删除品牌列表
unset
(
$data
[
'list'
][
'filters'
][
'brand'
]);
//删除折扣分类
unset
(
$data
[
'list'
][
'allDiscount'
]);
//删除新品分类
unset
(
$data
[
'list'
][
'newSales'
]);
return
$data
;
}
...
...
yohobuy/www.yohobuy.com/application/models/Product/Search.php
View file @
7d703b2
...
...
@@ -28,12 +28,12 @@ class SearchModel
* @author sefon 2015-12-17 16:12:18
* @return array
*/
public
static
function
getSearchData
(
$condition
,
$options
)
public
static
function
getSearchData
(
$condition
,
$options
,
$classes
)
{
// 调用接口查询商品数据
$result
=
SearchData
::
searchElasticByCondition
(
$condition
);
// 调用分类信息
$category
=
SearchData
::
getClassesData
();
$category
=
SearchData
::
getClassesData
(
$classes
);
if
(
isset
(
$category
[
'code'
])
&&
$category
[
'code'
]
===
200
)
{
$result
[
'data'
][
'filter'
][
'group_sort'
]
=
$category
[
'data'
][
'sort'
];
}
...
...
@@ -52,10 +52,10 @@ class SearchModel
$res
=
HelperSearch
::
getList
(
$result
,
$options
);
$list
=
HelperSearch
::
getTemplateData
(
$res
,
$options
);
$data
=
array
(
'productListPage'
=>
true
,
//初始化js
'list'
=>
$list
);
}
return
$data
;
}
'productListPage'
=>
true
,
//初始化js
'list'
=>
$list
);
}
return
$data
;
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment