PHPackages                             aoxiang/luxury-product - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. aoxiang/luxury-product

ActiveLibrary

aoxiang/luxury-product
======================

Luxury Product List

046PHP

Since Jun 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/aoxiang594/luxury-product)[ Packagist](https://packagist.org/packages/aoxiang/luxury-product)[ RSS](/packages/aoxiang-luxury-product/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)DependenciesVersions (1)Used By (0)

Luxury Product Library
======================

[](#luxury-product-library)

概述
--

[](#概述)

Luxury Product 是一个产品库SDK，需配合产品库使用。包含了分类、品牌、系列、型号等属性

安装
--

[](#安装)

> composer require aoxiang/luxury-product dev-master

使用
--

[](#使用)

```
require_once __DIR__ . '/vendor/autoload.php';
use luxury\Client;
$client = new Client("http://127.0.0.1:8089");
$data = $client->getTopCategory();

var_dump($data);
```

##### 得到结果

[](#得到结果)

```
{
    "list": [{
        "category_id": "1",
        "category_name": "腕表",
        "parent_id": "0",
        "alias": "机芯",
        "keywords": "腕表,手表,表",
        "logo": "miniapp\/static\/watch.png",
        "sort": "40"
    }, {
        "category_id": "2",
        "category_name": "箱包",
        "parent_id": "0",
        "alias": "",
        "keywords": "箱包",
        "logo": "miniapp\/static\/bag.png",
        "sort": "30"
    }, {
        "category_id": "4",
        "category_name": "首饰",
        "parent_id": "0",
        "alias": "",
        "keywords": "首饰",
        "logo": "miniapp\/static\/jewelry.png",
        "sort": "20"
    }, {
        "category_id": "3",
        "category_name": "服饰",
        "parent_id": "0",
        "alias": "",
        "keywords": "服饰",
        "logo": "miniapp\/static\/clothes.png",
        "sort": "10"
    }],
    "total": "4",
    "totalPage": "1",
    "page": 1
}
```

文档目录
----

[](#文档目录)

1. 分类
    - [获取顶级分类](#getTopCategory)
    - [获取子分类](#getChildAttribute)
2. 品牌、系列、型号
    - [获取所有品牌](#getBrandList)
    - [获取品牌下的系列](#getSeriesList)
    - [获取系列下的型号](#getModelList)
    - [搜索品牌](#searchBrand)
    - [搜索系列](#searchSeries)
    - [搜索型号](#searchModel)
3. 属性
    - [获取某个分类下的属性](#getTopAttribute)
    - [获取某个属性的子属性](#getChildAttribute)
4. 产品
    - [通过型号搜索某个产品](#searchProductByModel)
    - [获取某个产品的详细信息](#getProduct)
    - [通过品牌获取产品信息列表](#getProductByBrandId)
    - [通过系列获取产品信息列表](#getProductBySeriesId)
    - [通过型号获取产品信息列表](#getProductByModelId)
    - [筛选产品](#filterProduct)

#### 获取顶级分类

[](#获取顶级分类)

调用代码

```
$client->getTopCategory();
```

返回结果

```
{
    "code": "200",
    "data": {
        "list": [
            {
                "category_id": "1",
                "category_name": "腕表",
                "parent_id": "0",
                "alias": "机芯",
                "keywords": "腕表,手表,表",
                "logo": "miniapp/static/watch.png",
                "sort": "40"
            },
            {
                "category_id": "2",
                "category_name": "箱包",
                "parent_id": "0",
                "alias": "",
                "keywords": "箱包",
                "logo": "miniapp/static/bag.png",
                "sort": "30"
            },
            {
                "category_id": "4",
                "category_name": "首饰",
                "parent_id": "0",
                "alias": "",
                "keywords": "首饰",
                "logo": "miniapp/static/jewelry.png",
                "sort": "20"
            },
            {
                "category_id": "3",
                "category_name": "服饰",
                "parent_id": "0",
                "alias": "",
                "keywords": "服饰",
                "logo": "miniapp/static/clothes.png",
                "sort": "10"
            }
        ],
        "total": "4",
        "totalPage": "1",
        "page": 1
    },
    "error": "",
    "errorNo": ""
}
```

参数说明

键类型说明category\_idstring分类idcategory\_namestring分类名称parent\_idstring父级idaliasstring别名keywordsstring搜索关键词logostringlogosortstring排序#### 获取子分类

[](#获取子分类)

获取某个分类下的子分类

调用代码

```
$client->getChildCategory($categoryId);
$client->getChildCategory(1);
```

返回参数参考[获取顶级分类](#getTopCategory)

#### 获取某个分类下所有品牌

[](#获取某个分类下所有品牌)

调用代码

```
$client->getBrandList($categoryId);
$client->getBrandList(1);
```

```
{
    "code": "200",
    "data": {
        "list": [
            {
                "brand_id": "1",
                "brand_name": "爱彼",
                "parent_id": "0",
                "logo": "",
                "category_id": "1",
                "sort": "50",
                "initial": "A",
                "type": "1"
            },
            {
                "brand_id": "10",
                "brand_name": "艾米龙",
                "parent_id": "0",
                "logo": "",
                "category_id": "1",
                "sort": "50",
                "initial": "A",
                "type": "1"
            }
            //...
        ],
        "total": "77",
        "totalPage": "1",
        "page": "1"
    },
    "error": "",
    "errorNo": ""
}
```

参数说明

键类型说明brand\_idstring品牌idbrand\_namestring品牌名称parent\_idstring父级idinitialstring首字母category\_idstring分类idlogostringlogosortstring排序typestring1-品牌，2-系列，3-型号### 获取品牌下的系列

[](#获取品牌下的系列)

相比获取品牌，会多出series\_name、series\_id了两个参数

```
$client->getSeriesList($brandId);//传入品牌id
$client->getSeriesList(1);
```

```
{
    "code": "200",
    "data": {
        "list": [
            {
                "brand_id": "9",
                "brand_name": "传统TRADITION",
                "parent_id": "1",
                "logo": "",
                "category_id": "1",
                "sort": "50",
                "initial": "C",
                "type": "2",
                "series_name": "传统TRADITION",
                "series_id": "9"
            },
            {
                "brand_id": "2",
                "brand_name": "高级珠宝HAUTE JOAILLERIE系列",
                "parent_id": "1",
                "logo": "",
                "category_id": "1",
                "sort": "50",
                "initial": "G",
                "type": "2",
                "series_name": "高级珠宝HAUTE JOAILLERIE系列",
                "series_id": "2"
            }
            //...
        ],
        "total": "77",
        "totalPage": "1",
        "page": "1"
    },
    "error": "",
    "errorNo": ""
}
```

参数说明

键类型说明series\_idstring系列idseries\_namestring系列名称#### 获取系列下的型号

[](#获取系列下的型号)

相比获取品牌，会多出model\_name、model\_id了两个参数,

```
$client->getModelList($seriesId);//传入系列id
$client->getModelList(9);
```

```
{
    "code": "200",
    "data": {
        "list": [
            {
                "brand_id": "2131",
                "brand_name": "15334OR.OO.A092CR.01",
                "parent_id": "9",
                "logo": "",
                "category_id": "1",
                "sort": "50",
                "initial": "1",
                "type": "3",
                "model_name": "15334OR.OO.A092CR.01",
                "model_id": "2131"
            },
            //...
        ],
        "total": "77",
        "totalPage": "1",
        "page": "1"
    },
    "error": "",
    "errorNo": ""
}
```

参数说明

键类型说明model\_idstring型号idmodel\_namestring型号名称#### 搜索品牌

[](#搜索品牌)

```
$client->searchBrand($name,$categoryId);
```

参数说明

键类型说明namestring品牌名称category\_idstring分类id返回参数及参数说明参考[获取品牌列表](#getBrandList)

#### 搜索系列

[](#搜索系列)

```
$client->searchSeries($name,$categoryId);
```

参数说明

键类型说明namestring系列名称category\_idstring分类名称返回参数及参数说明参考[获取系列列表](#getSearchList)

#### 搜索型号

[](#搜索型号)

```
$client->searchModel($name,$categoryId);
```

参数说明

键类型说明namestring型号名称category\_idstring型号id返回参数及参数说明参考[获取型号列表](#getModelList)

#### 获取某个分类下的属性

[](#获取某个分类下的属性)

```
$client->getTopAttribute($categoryId);
$client->getTopAttribute(1);
```

```
{
    "code": "200",
    "data": [
        {
            "attribute_id": "70275",
            "attribute_name": "附件",
            "attribute_type": "checkbox",
            "logo": "nologo.png",
            "usage": "3",
            "format": "",
            "parent_id": "0",
            "category_id": "1",
            "attribute_value": [],
            "children": {
                "list": [
                    {
                        "attribute_id": "70402",
                        "attribute_name": "国检卡",
                        "attribute_type": "checkbox",
                        "logo": "nologo.png",
                        "usage": "3",
                        "parent_id": "70275",
                        "format": "",
                        "category_id": "1"
                    },
                    {
                        "attribute_id": "70403",
                        "attribute_name": "中检证书",
                        "attribute_type": "checkbox",
                        "logo": "nologo.png",
                        "usage": "3",
                        "parent_id": "70275",
                        "format": "",
                        "category_id": "1"
                    }
                ],
                "totalPage": "1",
                "total": "6",
                "page": "1"
            }
        },
        {
            "attribute_id": "11",
            "attribute_name": "表径",
            "attribute_type": "text",
            "logo": "nologo.png",
            "usage": "3",
            "format": "",
            "parent_id": "0",
            "category_id": "1",
            "attribute_value": "",
            "children": {
                "list": [],
                "totalPage": "1",
                "total": "0",
                "page": "1"
            }
        }
        {
            "attribute_id": "32",
            "attribute_name": "表扣材质",
            "attribute_type": "select",
            "logo": "nologo.png",
            "usage": "3",
            "format": "",
            "parent_id": "0",
            "category_id": "1",
            "attribute_value": "",
            "children": {
                "list": [
                    {
                        "attribute_id": "70189",
                        "attribute_name": "铜",
                        "attribute_type": "select",
                        "logo": "logo/6mpd0eo1n29.jpg",
                        "usage": "3",
                        "parent_id": "32",
                        "format": "",
                        "category_id": "1"
                    },
                    {
                        "attribute_id": "70190",
                        "attribute_name": "镀金",
                        "attribute_type": "select",
                        "logo": "/attribute/material/dujin.png",
                        "usage": "3",
                        "parent_id": "32",
                        "format": "",
                        "category_id": "1"
                    }
                ],
                "totalPage": "1",
                "total": "14",
                "page": "1"
            }
        }
    ],
    "error": "",
    "errorNo": ""
}
```

键类型说明attribute\_idstring属性idattribute\_namestring属性名称attribute\_typestring属性类型，text-文本，checkbox-多选，select-单选logostringlogousagestring用途，3入库时属性用的formatstring属性格式parent\_idstring父级属性idcategory\_idstring分类ID- childrenobject如果有子属性（checkbox\\select）的话，这里包含子属性#### 获取某个属性的子属性

[](#获取某个属性的子属性)

```
$client->getChildrenAttribute($attributeId);
$client->getChildrenAttribute(32);
```

返回参数及参数说明参考[获取顶级属性列表](#getTopAttribute)

#### 通过型号搜索某个产品

[](#通过型号搜索某个产品)

```
$client->searchProductByModel($model, $page);//型号名称，页码
$client->searchProductByModel("L12",1);
```

```
{
    "code": "200",
    "errorNo": "",
    "error": "",
    "errorInfo": [],
    "data": {
        "list": [
            {
                "product_id": "47812",
                "category_id": "1",
                "title": "宇舶BIG BANG 322.CI.1123.GR",
                "brand_id": "898",
                "series_id": "902",
                "model_id": "46290",
                "brand_name": "宇舶",
                "series_name": "BIG BANG",
                "model_name": "322.CI.1123.GR",
                "public_price": "141500.00",
                "photo": "http://productimg.xbiao.com/63/240_360/920914683800185.jpg"
            }
        ],
        "total": "733",
        "totalPage": "37",
        "page": "3"
    }
}
```

键类型说明product\_idstring产品idcategory\_idstring分类IDtitlestring标题brand\_idstring产品品牌series\_idstring产品系列model\_idstring产品型号brand\_namestring品牌名称series\_namestring系列名称model\_namestring型号名称public\_pricestring公价photostring产品图片返回参数及参数说明参考[获取顶级属性列表](#getTopAttribute)

#### 获取某个产品的详细信息

[](#获取某个产品的详细信息)

```
$client->getProduct($productId);//型号ID
$client->getProduct(49729);
```

```
{
    "code": "200",
    "errorNo": "",
    "error": "",
    "errorInfo": [],
    "data": {
        "product_id": "49729",
        "category_id": "1",
        "title": "依波时代元素50280216",
        "brand_id": "956",
        "series_id": "972",
        "model_id": "48205",
        "brand_name": "依波",
        "series_name": "时代元素MODERN ELEMENTS",
        "model_name": "50280216",
        "public_price": "1480.00",
        "photo": "http://productimg.xbiao.com/91/240_360/4813314703776156.gif",
        "add_time": "2017-11-30 16:34:12",
        "attribute_list": [
            {
                "product_attribute_id": "1178292",
                "product_id": "49729",
                "attribute_id": "7",
                "mark": "jixinleixing",
                "attribute_name": "机芯类型",
                "attribute_value": "230,230",
                "attribute_value_name": "石英,石英",
                "attribute_type": "select",
                "parent_id": "0"
            }
        ]
    }
}
```

参数说明

键类型说明product\_idstring产品idcategory\_idstring分类IDtitlestring标题brand\_idstring产品品牌series\_idstring产品系列model\_idstring产品型号brand\_namestring品牌名称series\_namestring系列名称model\_namestring型号名称public\_pricestring公价photostring产品图片attribute\_liststring属性列表属性列表中参数说明

键类型说明product\_attribute\_idstring产品属性值idproduct\_idstring产品IDattribute\_idstring属性IDmarkstring标识attribute\_namestring属性名称attribute\_valuestring属性值id，如果是多选，这里是个数组attribute\_value\_namestring属性值名称attribute\_typestring属性类型parent\_idstring父级属性id#### 通过品牌获取产品信息列表

[](#通过品牌获取产品信息列表)

```
$client->getProductByBrandId($brandId);
$client->getProductByBrandId(1);
```

```
{
    "code": "200",
    "errorNo": "",
    "error": "",
    "errorInfo": [],
    "data": {
        "list": [
            {
                "product_id": "926",
                "category_id": "1",
                "title": "艾米龙挑战者 08.1169.G.6.AW.98.6",
                "brand_id": "10",
                "series_id": "11",
                "model_id": "2136",
                "brand_name": "艾米龙",
                "series_name": "挑战者",
                "model_name": " 08.1169.G.6.AW.98.6",
                "public_price": "11200.00",
                "photo": "http://productimg.xbiao.com/101/240_360/3429014611429948.jpg",
                "add_time": "2017-11-30 13:40:22"
            }
        ],
        "total": "733",
        "totalPage": "1",
        "page": "1"
    }
}
```

返回参数及参数说明参考[通过型号搜索产品](#searchProductByModel)

#### 通过系列获取产品信息列表

[](#通过系列获取产品信息列表)

```
$client->getProductBySeriesId($seriesId);
$client->getProductBySeriesId(2);
```

```
{
    "code": "200",
    "errorNo": "",
    "error": "",
    "errorInfo": [],
    "data": {
        "list": [
            {
                "product_id": "1",
                "category_id": "1",
                "title": "爱彼高级珠宝79418BC.ZZ.9188BC.01",
                "brand_id": "1",
                "series_id": "2",
                "model_id": "1285",
                "brand_name": "爱彼",
                "series_name": "高级珠宝HAUTE JOAILLERIE系列",
                "model_name": "79418BC.ZZ.9188BC.01",
                "public_price": "5638000.00",
                "photo": "http://productimg.xbiao.com/57/240_360/3781014690949321.jpg",
                "add_time": "2017-11-30 13:38:20"
            }
        ],
        "total": "733",
        "totalPage": "1",
        "page": "1"
    }
}
```

返回参数及参数说明参考[通过型号搜索产品](#searchProductByModel)

#### 通过型号获取产品信息列表

[](#通过型号获取产品信息列表)

```
$client->getProductByModelId($modelId);
$client->getProductByModelId(2216);
```

```
{
    "code": "200",
    "errorNo": "",
    "error": "",
    "errorInfo": [],
    "data": {
        "product_id": "1006",
        "category_id": "1",
        "title": "艾米龙莱蒙15.1168.G42.6.8.68.2",
        "brand_id": "10",
        "series_id": "17",
        "model_id": "2216",
        "brand_name": "艾米龙",
        "series_name": "莱蒙",
        "model_name": "15.1168.G42.6.8.68.2",
        "public_price": "18000.00",
        "photo": "http://productimg.xbiao.com/101/240_360/3377714036832777.jpg",
        "add_time": "2017-11-30 13:40:33",
        "attribute_list": [
            {
                "product_attribute_id": "27447",
                "product_id": "1006",
                "attribute_id": "7",
                "mark": "jixinleixing",
                "attribute_name": "机芯类型",
                "attribute_value": "8,8",
                "attribute_value_name": "自动机械,自动机械",
                "attribute_type": "select",
                "parent_id": "0"
            }
        ]
    }
}
```

返回参数及参数说明参考[通过型号搜索产品](#searchProductByModel)

#### 筛选产品

[](#筛选产品)

```
 $filterList = array(
             'brand_id'   => array(1, 10),
             'sex'        => array(1),
             'size'       => array(25),
             'core_type'  => array(1),
             'min_price'  => 10000,
             'max_price'  => 50000,
             'material'   => array(26),
             'watch_band' => array(70394, 70396)
         );
$client->filterProduct($filterList,$page);
```

筛选参数说明，筛选内容全部都都是多选

键类型说明brand\_idarray筛选的品牌sexarray性别sizearray尺寸core\_typearray机芯类型materialarray表壳材质watch\_bandarray表带材质min\_pricearray价格范围最低价max\_pricearray价格范围最高价返回参数及参数说明参考[通过型号搜索产品](#searchProductByModel)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd64200aa6a7471bc379dbe2ec71a3a03933ae2f96886c4fea88ea2e76d04309?d=identicon)[aoxiang594](/maintainers/aoxiang594)

---

Top Contributors

[![9yearfish](https://avatars.githubusercontent.com/u/11186536?v=4)](https://github.com/9yearfish "9yearfish (27 commits)")

### Embed Badge

![Health badge](/badges/aoxiang-luxury-product/health.svg)

```
[![Health](https://phpackages.com/badges/aoxiang-luxury-product/health.svg)](https://phpackages.com/packages/aoxiang-luxury-product)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
