简要描述:
根据历史记录重新发起搜索,返回最新商品结果,不新增新的历史记录。
请求域名:
- http://xx.com
请求路由:
/addons/yun_shop/api.php?i=商城ID&route=plugin.yz-supply-visual-search.frontend.history.re-search
请求参数说明:
| 参数名 | 类型 | 说明 |
|---|---|---|
| record_id | int | 历史记录 ID |
| page | int | 页码,默认 1 |
| page_size | int | 每页数量,默认 20 |
返回示例:
正确时返回
{
"result": 1,
"msg": "成功",
"data": {
"record_id": 12,
"record": {
"id": 12,
"image": "https://example.com/uploads/visual-search/demo.jpg",
"matched_goods_ids": [10001, 10002],
"middleground_configuration_id": 3,
"returned_goods_count": 2,
"searched_imported_goods_count": 1,
"searched_unimported_goods_count": 1,
"new_imported_goods_count": 0,
"status": 1,
"created_at": 1775721600,
"created_at_text": "2026-04-08 12:00:00"
},
"search_meta": {
"img_search_url": "https://example.com/uploads/visual-search/demo.jpg",
"enable_cloud_goods": 1
},
"pagination": {
"current_page": 1,
"per_page": 20,
"total": 2
},
"summary": {
"local_count": 1,
"cloud_count": 1,
"imported_count": 1,
"unimported_count": 1
},
"goods_list": {
"local": [
{
"yz_goods_id": 10001,
"middleground_configuration_id": 3,
"source_type": "local",
"is_imported": 1,
"local_goods_id": 556,
"title": "同款女包",
"image_url": "https://example.com/uploads/goods/bag.jpg",
"thumb": "https://example.com/uploads/goods/bag.jpg",
"agreement_price": "89.00",
"guide_price": "129.00",
"sale_price": "99.00",
"market_price": "139.00",
"local_goods": {
"id": 556,
"title": "同款女包",
"thumb": "https://example.com/uploads/local/bag.jpg",
"status": 1,
"price": "99.00",
"market_price": "139.00"
},
"cloud_goods": {
"id": 10001,
"title": "同款女包",
"image_url": "https://example.com/uploads/goods/bag.jpg"
}
}
],
"cloud": [
{
"yz_goods_id": 10002,
"middleground_configuration_id": 3,
"source_type": "cloud",
"is_imported": 0,
"local_goods_id": 0,
"title": "新品帆布包",
"image_url": "https://example.com/uploads/goods/canvas-bag.jpg",
"thumb": "https://example.com/uploads/goods/canvas-bag.jpg",
"agreement_price": "59.00",
"guide_price": "79.00",
"sale_price": "69.00",
"market_price": "89.00",
"local_goods": null,
"cloud_goods": {
"id": 10002,
"title": "新品帆布包",
"image_url": "https://example.com/uploads/goods/canvas-bag.jpg"
}
}
]
},
}
}
返回参数说明:
| 参数名 | 类型 | 说明 | |
|---|---|---|---|
| result | int | 接口状态,1 表示成功 |
|
| msg | string | 返回提示 | |
| data.record_id | int | 历史搜索记录 ID | |
| data.record | object | 历史记录摘要 | |
| data.record.id | int | 搜索记录 ID | |
| data.record.image | string | 搜索图片地址 | |
| data.record.matched_goods_ids | array | 命中的供应链商品 ID 集合 | |
| data.record.middleground_configuration_id | int | 中台配置 ID | |
| data.record.returned_goods_count | int | 原记录返回商品总数 | |
| data.record.searched_imported_goods_count | int | 原记录搜索时已导入商品数量 | |
| data.record.searched_unimported_goods_count | int | 原记录搜索时未导入商品数量 | |
| data.record.new_imported_goods_count | int | 原记录后续新增导入商品数量 | |
| data.record.status | int | 记录状态,0 失败,1 成功,2 无结果 |
|
| data.record.created_at | int | 创建时间戳 | |
| data.record.created_at_text | string | 创建时间文本 | |
| data.search_meta | object | 搜索附加信息 | |
| data.search_meta.img_search_url | string | 本次实际使用的图片地址 | |
| data.search_meta.enable_cloud_goods | int | 是否展示云商品,1 展示,0 不展示 |
|
| data.pagination | object | 分页信息 | |
| data.pagination.current_page | int | 当前页码 | |
| data.pagination.per_page | int | 每页数量 | |
| data.pagination.total | int | 商品总数 | |
| data.summary | object | 搜索结果汇总 | |
| data.summary.local_count | int | 本地商品数量 | |
| data.summary.cloud_count | int | 云商品数量 | |
| data.summary.imported_count | int | 已导入商品数量 | |
| data.summary.unimported_count | int | 未导入商品数量 | |
| data.goods_list | object | 按来源拆分的商品结果 | |
| data.goods_list.local | array | 本地商品列表 | |
| data.goods_list.cloud | array | 云商品列表 | |
| data.local_list | array | 本地商品平铺列表 | |
| data.cloud_list | array | 云商品平铺列表 | |
| data.goods_list.local[].yz_goods_id | int | 供应链商品 ID | |
| data.goods_list.local[].middleground_configuration_id | int | 中台配置 ID | |
| data.goods_list.local[].source_type | string | 商品来源,local 或 cloud |
|
| data.goods_list.local[].is_imported | int | 是否已导入,1 是,0 否 |
|
| data.goods_list.local[].local_goods_id | int | 本地商品 ID,未导入时为 0 |
|
| data.goods_list.local[].title | string | 商品标题 | |
| data.goods_list.local[].image_url | string | 商品图片地址 | |
| data.goods_list.local[].thumb | string | 商品缩略图地址 | |
| data.goods_list.local[].agreement_price | string | 协议价 | |
| data.goods_list.local[].guide_price | string | 指导价 | |
| data.goods_list.local[].sale_price | string | 销售价 | |
| data.goods_list.local[].market_price | string | 市场价 | |
| data.goods_list.local[].local_goods | object | null | 本地商品快照,云商品时为 null |
| data.goods_list.local[].cloud_goods | object | 供应链原始商品数据 |