订单列表

接口描述
  • 订单列表
请求URL
  • /api/orders
请求方式
  • GET
请求头部
参数名 必选 类型 说明
Authorization string JWT token
Query 请求参数
参数名 必选 类型 说明
page int 分页
title string 标题模糊搜索
status int 订单状态: 1下单 2支付 3发货 4收货 5过期
include string 包含额外的数据: goods 商品,user 用户 ,orderDetails订单详情

inlude可以返回额外的数据, 多个使用 分隔, 比如: include=goods,user,orderDetails
多层关联可以是 ., 比如要获取订单细节的同时,还要获取细节关联的商品:include=orderDetails.goods

推荐使用的方式: include=orderDetails.goods

返回参数

data

参数名 必含 类型 说明
id int 自增长主键ID
order_no string 单号
user_id int 创建者
amount int 总价
status int 状态
address_id int 收货地址
express_type string 快递类型
express_no string 快递号
pay_time int 支付时间
pay_type string 支付类型
trade_no string 支付流水号
created_at timestamp 添加时间
updated_at timestamp 修改时间

meta.pagination

参数名 必含 类型 说明
total int 数据总数
count int 当前页数据
per_page int 每页显示条数
current_page int 当前页页码
total_pages int 总页数
links.previous string 上一页链接
links.next string 下一页链接
返回示例
  • 状态码 200 请求成功
 {
    "data": [
        {
            "id": 7,
            "order_no": "20210922101816835949",
            "user_id": 1,
            "amount": "9086.00",
            "status": 4,
            "address_id": 40,
            "express_type": "YD",
            "express_no": "20210922101818587474",
            "pay_time": "2021-09-23 11:44:50",
            "pay_type": "支付宝",
            "trade_no": "2021092322001425560501700091",
            "created_at": "2021-09-22T03:16:16.000000Z",
            "updated_at": "2021-09-24T13:17:43.000000Z",
            "goods": {
                "data": [
                    {
                        "id": 22,
                        "title": "Fugiat in saepe hic.",
                        "category_id": 70,
                        "description": "Repellat nulla atque non voluptatum.",
                        "price": 245,
                        "stock": 1570,
                        "pics": [
                            "http://placeimg.com/640/480/any",
                            "http://placeimg.com/640/480/any",
                            "http://placeimg.com/640/480/any"
                        ],
                        "pics_url": [
                            "http://placeimg.com/640/480/any",
                            "http://placeimg.com/640/480/any",
                            "http://placeimg.com/640/480/any"
                        ],
                        "cover": "http://placeimg.com/640/480/any",
                        "cover_url": "http://placeimg.com/640/480/any",
                        "details": "Suscipit totam omnis molestias eos veniam et nihil sed. Ea velit doloremque quia debitis. Praesentium quam voluptatem consequatur. Eum repudiandae quis enim qui esse.\n\nTenetur autem nostrum quia sit. Illum sunt vero illo ipsa numquam quibusdam. Sint et quaerat ut soluta ut voluptatibus.\n\nCorporis in repellat et voluptates vero eos ducimus. Porro animi accusamus quod. Iste enim non nisi veritatis. Provident error labore ratione doloribus cumque qui ipsum. Aperiam enim eos sint ullam ratione enim est.\n\nIn ut exercitationem modi expedita. Porro quaerat est excepturi ut aperiam possimus qui. Facere ut quis placeat earum eaque.",
                        "is_on": 1,
                        "is_recommend": 1,
                        "created_at": "2021-09-17T01:49:16.000000Z",
                        "updated_at": "2021-09-24T13:17:43.000000Z"
                    },
                    {
                        "id": 23,
                        "title": "Officia ullam vel.",
                        "category_id": 74,
                        "description": "Vel eum nostrum quam repellat.",
                        "price": 756,
                        "stock": 4275,
                        "pics": [
                            "http://placeimg.com/640/480/any",
                            "http://placeimg.com/640/480/any",
                            "http://placeimg.com/640/480/any"
                        ],
                        "pics_url": [
                            "http://placeimg.com/640/480/any",
                            "http://placeimg.com/640/480/any",
                            "http://placeimg.com/640/480/any"
                        ],
                        "cover": "http://placeimg.com/640/480/any",
                        "cover_url": "http://placeimg.com/640/480/any",
                        "details": "Est eos incidunt voluptate reprehenderit. Quia et dicta quod nostrum laudantium quis praesentium. Qui consequatur aut vel.\n\nMagni enim animi sint eveniet quasi ut consequatur. Expedita molestiae atque aut blanditiis nihil laboriosam. Explicabo et rerum omnis molestiae error recusandae ut quos. Inventore distinctio aut et tenetur vitae vel iste.\n\nNeque laboriosam illo vero expedita. Maiores velit voluptatibus dolorem ipsum ipsa officiis eaque. Aspernatur eaque quidem possimus eos sint. Molestiae similique consequatur eos alias et repudiandae.\n\nPerferendis officiis magnam ex quo. Ut optio amet dolorum commodi eos velit mollitia. Perspiciatis velit dolorem nam porro ipsum rem. Ut sit culpa odit provident sequi suscipit. Voluptas corrupti voluptates voluptatem quasi.",
                        "is_on": 1,
                        "is_recommend": 1,
                        "created_at": "2021-09-17T01:49:16.000000Z",
                        "updated_at": "2021-09-24T13:17:43.000000Z"
                    }
                ]
            }
        },
        {
            "id": 8,
            "order_no": "20210924131945693669",
            "user_id": 1,
            "amount": "245.00",
            "status": 5,
            "address_id": 40,
            "express_type": null,
            "express_no": null,
            "pay_time": null,
            "pay_type": null,
            "trade_no": null,
            "created_at": "2021-09-24T05:19:45.000000Z",
            "updated_at": "2021-09-24T12:13:41.000000Z",
            "goods": {
                "data": [
                    {
                        "id": 22,
                        "title": "Fugiat in saepe hic.",
                        "category_id": 70,
                        "description": "Repellat nulla atque non voluptatum.",
                        "price": 245,
                        "stock": 1570,
                        "pics": [
                            "http://placeimg.com/640/480/any",
                            "http://placeimg.com/640/480/any",
                            "http://placeimg.com/640/480/any"
                        ],
                        "pics_url": [
                            "http://placeimg.com/640/480/any",
                            "http://placeimg.com/640/480/any",
                            "http://placeimg.com/640/480/any"
                        ],
                        "cover": "http://placeimg.com/640/480/any",
                        "cover_url": "http://placeimg.com/640/480/any",
                        "details": "Suscipit totam omnis molestias eos veniam et nihil sed. Ea velit doloremque quia debitis. Praesentium quam voluptatem consequatur. Eum repudiandae quis enim qui esse.\n\nTenetur autem nostrum quia sit. Illum sunt vero illo ipsa numquam quibusdam. Sint et quaerat ut soluta ut voluptatibus.\n\nCorporis in repellat et voluptates vero eos ducimus. Porro animi accusamus quod. Iste enim non nisi veritatis. Provident error labore ratione doloribus cumque qui ipsum. Aperiam enim eos sint ullam ratione enim est.\n\nIn ut exercitationem modi expedita. Porro quaerat est excepturi ut aperiam possimus qui. Facere ut quis placeat earum eaque.",
                        "is_on": 1,
                        "is_recommend": 1,
                        "created_at": "2021-09-17T01:49:16.000000Z",
                        "updated_at": "2021-09-24T13:17:43.000000Z"
                    }
                ]
            }
        }
    ],
    "meta": {
        "pagination": {
            "total": 2,
            "count": 2,
            "per_page": 3,
            "current_page": 1,
            "total_pages": 1,
            "links": null
        }
    }
}