订单列表
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\common\model\OrderModel::orderList |
| 所属业务 | 订单管理 |
| 来源模块/系统 | 订单模型 |
功能说明
订单列表
调用示例
$param = ['keywords' => '示例关键字', 'client_id' => 1, 'type' => 'string', 'status' => 'Active', 'amount' => 'string', 'gateway' => ['credit'], 'start_time' => 1752984000, 'end_time' => 1752984000, 'order_id' => 1, 'product_id' => '1', 'username' => '示例名称', 'email' => 'user@example.com', 'phone' => '13800138000', 'pay_time' => 1752984000, 'page' => 1, 'limit' => 1, 'orderby' => 'id', 'sort' => 'string', 'start_recycle_time' => 1752984000, 'end_recycle_time' => 1752984000, 'start_pay_time' => 1752984000, 'end_pay_time' => 1752984000];
$scene = 'string';
$result = (new \app\common\model\OrderModel())->orderList($param, $scene);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
param.keywords | string | 否 | — | — | 关键字,搜索范围:订单ID,商品名称,用户名称,邮箱,手机号 |
param.client_id | int | 否 | — | — | 用户ID |
param.type | string | 否 | — | — | 类型new新订单renew续费订单upgrade升降级订单artificial人工订单 |
param.status | string | 否 | — | — | 状态Unpaid未付款Paid已付款 |
param.amount | string | 否 | — | — | 金额 |
param.gateway | array | 否 | — | — | 支付方式 |
param.start_time | int | 否 | — | — | 开始时间 |
param.end_time | int | 否 | — | — | 结束时间 |
param.order_id | int | 否 | — | — | 订单ID |
param.product_id | string | 否 | — | — | 商品ID |
param.username | string | 否 | — | — | 用户名称 |
param.email | string | 否 | — | — | 邮箱 |
param.phone | string | 否 | — | — | 手机号 |
param.pay_time | int | 否 | — | — | 支付时间 |
param.page | int | 否 | — | — | 页数 |
param.limit | int | 否 | — | — | 每页条数 |
param.orderby | string | 否 | id | — | 排序(id,amount,client_id,reg_time) |
param.sort | string | 否 | — | — | 升/降序 asc,desc |
param.start_recycle_time | int | 否 | — | — | 回收开始时间(scene=recycle有效) |
param.end_recycle_time | int | 否 | — | — | 回收结束时间(scene=recycle有效) |
param.start_pay_time | int | 否 | — | — | 搜索:开始支付时间 |
param.end_pay_time | int | 否 | — | — | 搜索:结束支付时间 |
scene | string | 否 | — | — | 场景(recycle_bin=回收站) |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
list | array | 订单 |
list[].id | int | 订单ID |
list[].type | string | 类型new新订单renew续费订单upgrade升降级订单artificial人工订单 |
list[].create_time | int | 创建时间 |
list[].amount | string | 金额 |
list[].status | string | 状态Unpaid未付款Paid已付款Cancelled已取消Refunded已退款WaitUpload待上传WaitReview待审核ReviewFail审核失败 |
list[].gateway | string | 支付方式 |
list[].credit | float | 使用余额,大于0代表订单使用了余额,和金额相同代表订单支付方式为余额 |
list[].client_id | int | 用户ID,前台接口调用时不返回 |
list[].client_name | string | 用户名称,前台接口调用时不返回 |
list[].client_credit | string | 用户余额,前台接口调用时不返回 |
list[].email | string | 邮箱,前台接口调用时不返回 |
list[].phone_code | string | 国际电话区号,前台接口调用时不返回 |
list[].phone | string | 手机号,前台接口调用时不返回 |
list[].company | string | 公司,前台接口调用时不返回 |
list[].client_status | int | 用户是否启用0:禁用,1:正常,前台接口调用时不返回 |
list[].reg_time | int | 用户注册时间,前台接口调用时不返回 |
list[].country | string | 国家,前台接口调用时不返回 |
list[].address | string | 地址,前台接口调用时不返回 |
list[].language | string | 语言,前台接口调用时不返回 |
list[].notes | string | 备注,前台接口调用时不返回 |
list[].refund_amount | string | 订单已退款金额,前台接口调用时不返回 |
list[].host_name | string | 产品标识 |
list[].description | string | 描述 |
list[].product_names | array | 订单下所有产品的商品名称 |
list[].host_id | int | 产品ID |
list[].order_item_count | int | 订单子项数量 |
list[].is_lock | int | 是否锁定(0=否,1=是),scene=recycle_bin返回 |
list[].recycle_time | int | 放入回收站时间,scene=recycle_bin返回 |
list[].will_delete_time | int | 彻底删除时间,scene=recycle_bin返回 |
list[].certification | bool | 是否实名认证true是false否(显示字段有certification返回) |
list[].certification_type | string | 实名类型person个人company企业(显示字段有certification返回) |
list[].client_level | string | 用户等级(显示字段有client_level返回) |
list[].client_level_color | string | 用户等级颜色(显示字段有client_level返回) |
list[].sale | string | 销售(显示字段有sale返回) |
list[].addon_client_custom_field_[id] | string | 用户自定义字段(显示字段有addon_client_custom_field_[id]返回,[id]为用户自定义字段ID) |
list[].voucher | array | 上传的凭证 |
list[].review_fail_reason | string | 审核失败原因 |
list[].gateway_sign | string | 支付方式标识(credit=余额) |
count | int | 订单总数 |
total_amount | string | 总金额 |
page_total_amount | string | 当前页总金额 |
正常返回
{
"list": [
{
"id": 1,
"type": "string",
"create_time": 1752984000,
"amount": "string",
"status": "Active",
"gateway": "credit",
"credit": 0.01,
"client_id": 1,
"client_name": "示例名称",
"client_credit": "string",
"email": "user@example.com",
"phone_code": "86",
"phone": "13800138000",
"company": "string",
"client_status": 1,
"reg_time": 1752984000,
"country": "string",
"address": "string",
"language": "zh-cn",
"notes": "示例说明",
"refund_amount": "string",
"host_name": "示例名称",
"description": "192.0.2.1",
"product_names": [
"示例名称"
],
"host_id": 1,
"order_item_count": 1,
"is_lock": 1,
"recycle_time": 1752984000,
"will_delete_time": 1752984000,
"certification": true,
"certification_type": "string",
"client_level": "string",
"client_level_color": "string",
"sale": "string",
"addon_client_custom_field_[id]": "string",
"voucher": [
"string"
],
"review_fail_reason": "示例说明",
"gateway_sign": "example-token"
}
],
"count": 1,
"total_amount": "string",
"page_total_amount": "string"
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |