# liaos_api **Repository Path**: coolboyweizi/liaos_api ## Basic Information - **Project Name**: liaos_api - **Description**: 廖老板的API - **Primary Language**: PHP - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-05-30 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 接口请求 **分类** - 请求方式: 分页 - example: - url: domain/api/class?num=1 - 参数: num 分页量。默认设置5 - 返回: json ```json { "current_page":1, //当前页码 "data":[ // 数据集 { "id":59, // 分类ID "pa_name":"复合调料", // 名 "pa_sort":4, // 分类排序 "pa_parent":0, // 上级分类 } ], "first_page_url":"http:\/\/l.localhost\/api\/class?page=1", // 首页URL "from":1, // 跳转页 "last_page":4, // 上一页 "last_page_url":"http:\/\/l.localhost\/api\/class?page=4", // 上一页URL "next_page_url":"http:\/\/l.localhost\/api\/class?page=2", "path":"http:\/\/l.localhost\/api\/class", "per_page":"1", "prev_page_url":null, "to":1, "total":4, // 一共页码 } ``` **子分类** - 请求方式:分页 - example: - url: http://l.localhost/api/subClass?pid=57&num=1 - 参数: PID为分类的ID。num为分页量 - 返回: json ```json { "current_page":1, "data":[ { "id":313, // 子类ID, 用于查商品 "pa_name":"火锅料", // 分类名 "pa_sort":14, // 排序 "pa_parent":57, // 父类ID } ], "first_page_url":"http:\/\/l.localhost\/api\/subClass?page=1", "from":1, "last_page":32, "last_page_url":"http:\/\/l.localhost\/api\/subClass?page=32", "next_page_url":"http:\/\/l.localhost\/api\/subClass?page=2", "path":"http:\/\/l.localhost\/api\/subClass", "per_page":"1", "prev_page_url":null, "to":1, "total":32, } ``` **商品列表** - 请求方式: 分页 - example: - url: http://l.localhost/api/items?cid=303&num=5 - 参数: cid为子分类ID,num为分页量 - 返回: json ```json { "current_page": 1, "data": [{ "id": 80, "pa_id": 303, "co_name": "千禾一醋500ml (12瓶\/件)", "co_coverpicture": "updata\/18-11-11\/20181111155011456..jpg", "co_trademark": "千禾", "co_packaged": "瓶装", "co_salessum": 0, "co_mainpicture": "updata\/18-11-11\/20181111155005798..jpg@updata\/18-11-11\/20181111155005904..jpg@updata\/18-11-11\/20181111155005570..jpg@updata\/18-11-11\/20181111155005558..jpg@updata\/18-11-11\/20181111155005992..jpg@updata\/18-11-11\/20181111155005853..jpg@", "co_particular": "
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/p>
\r\n\t\t\t\t\t\t\t这里写商品详细样式\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/p>
\t\t\t\t\t\t\t<\/p>", "co_complimentary": "", "co_recommend": 0, "co_sales": 0, "co_releasetime": "2019-08-27 11:53:05", "co_state": 1 }], "first_page_url": "http:\/\/l.localhost\/api\/items?page=1", "from": 1, "last_page": 26, "last_page_url": "http:\/\/l.localhost\/api\/items?page=26", "next_page_url": "http:\/\/l.localhost\/api\/items?page=2", "path": "http:\/\/l.localhost\/api\/items", "per_page": "1", "prev_page_url": null, "to": 1, "total": 26 } ``` **商品详情** - 请求方式: 详情 - example: - url: http://l.localhost/api/items?cid=303&num=5 - 参数: cid为子分类ID,num为分页量 - 返回: json ```json { "id": 80, "pa_id": 303, "co_name": "千禾一醋500ml (12瓶\/件)", "co_coverpicture": "updata\/18-11-11\/20181111155011456..jpg", "co_trademark": "千禾", "co_packaged": "瓶装", "co_salessum": 0, "co_mainpicture": "updata\/18-11-11\/20181111155005798..jpg@updata\/18-11-11\/20181111155005904..jpg@updata\/18-11-11\/20181111155005570..jpg@updata\/18-11-11\/20181111155005558..jpg@updata\/18-11-11\/20181111155005992..jpg@updata\/18-11-11\/20181111155005853..jpg@", "co_particular": "
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/p>
\r\n\t\t\t\t\t\t\t这里写商品详细样式\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/p>
\t\t\t\t\t\t\t<\/p>", "co_complimentary": "", "co_recommend": 0, "co_sales": 0, "co_releasetime": "2019-08-27 11:53:05", "co_state": 1 } ``` **搜索调用** - 请求链接: http://l.localhost/api/search?keyword=搜索词&limit=int - example: - url: http://l.localhost/api/search?keyword=千禾 - keywords: 搜索关键词 - limit: 分页限制条数 - 返回: json ```json { "current_page": 1, "data": [{ "id": 80, "pa_id": 303, "co_name": "千禾一醋500ml (12瓶\/件)", "co_coverpicture": "updata\/18-11-11\/20181111155011456..jpg", "co_trademark": "千禾", "co_packaged": "瓶装", "co_salessum": 0, "co_mainpicture": "updata\/18-11-11\/20181111155005798..jpg@updata\/18-11-11\/20181111155005904..jpg@updata\/18-11-11\/20181111155005570..jpg@updata\/18-11-11\/20181111155005558..jpg@updata\/18-11-11\/20181111155005992..jpg@updata\/18-11-11\/20181111155005853..jpg@", "co_particular": "
\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/p>
\r\n\t\t\t\t\t\t\t这里写商品详细样式\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/p>
\t\t\t\t\t\t\t<\/p>", "co_complimentary": "", "co_recommend": 0, "co_sales": 0, "co_releasetime": "2019-08-27 11:53:05", "co_state": 1, "child_class": { "id": 303, "pa_name": "醋", "pa_sort": 4, "pa_parent": 57, "parent_class": { "id": 57, "pa_name": "调味品", "pa_sort": 1, "pa_parent": 0 } } }], "first_page_url": "http:\/\/l.localhost\/api\/search?query=&page=1", "from": 1, "last_page": 667, "last_page_url": "http:\/\/l.localhost\/api\/search?query=&page=667", "next_page_url": "http:\/\/l.localhost\/api\/search?query=&page=2", "path": "http:\/\/l.localhost\/api\/search", "per_page": "1", "prev_page_url": null, "to": 1, "total": 667 } ```