订单详情
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\common\model\OrderModel::indexOrder |
| 所属业务 | 订单管理 |
| 来源模块/系统 | 订单模型 |
功能说明
订单详情
调用示例
$id = 1;
$result = (new \app\common\model\OrderModel())->indexOrder($id);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
id | int | 是 | — | required | 订单ID |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
id | int | 订单ID |
type | string | 类型new新订单renew续费订单upgrade升降级订单artificial人工订单 |
amount | string | 金额 |
create_time | int | 创建时间 |
pay_time | int | 支付时间 |
status | string | 状态Unpaid未付款Paid已付款Cancelled已取消Refunded已退款WaitUpload待上传WaitReview待审核ReviewFail审核失败 |
gateway | string | 支付方式 |
credit | string | 使用余额,大于0代表订单使用了余额,和金额相同代表订单支付方式为余额 |
client_id | int | 用户ID |
client_name | string | 用户名称 |
notes | string | 备注 |
refund_amount | string | 订单已退款金额 |
amount_unpaid | string | 未支付金额 |
refundable_amount | string | 订单可退款金额 |
apply_credit_amount | string | 订单可应用余额金额 |
admin_id | int | 管理员ID |
admin_name | string | 管理员名称 |
is_recycle | int | 是否在回收站(0=否,1=是) |
refund_orginal | int | 订单支付方式退款时是否支持原路返回:1是,0否(退款至下拉就不显示'原支付路径') |
voucher | array | 上传的凭证 |
review_fail_reason | string | 审核失败原因 |
refund_credit | string | 已退款余额 |
refund_gateway | string | 已退款渠道 |
gateway_sign | string | 支付接口标识(credit=余额,credit_limit=信用额) |
unpaid_timeout | int | 未支付超时时间,0表示不限制 |
remain_pay_time | int | 剩余支付时间,配合unpaid_timeout使用 |
items | array | 订单子项 |
items[].id | int | 订单子项ID |
items[].description | string | 描述 |
items[].amount | string | 金额 |
items[].host_id | int | 产品ID |
items[].product_name | string | 商品名称 |
items[].host_name | string | 产品标识 |
items[].billing_cycle | string | 计费周期 |
items[].host_status | string | 产品状态Unpaid未付款Pending开通中Active使用中Suspended暂停Deleted删除Failed开通失败 |
items[].edit | int | 是否可编辑1是0否 |
items[].profit | string | 利润 |
items[].agent | int | 代理订单1是0否 |
正常返回
{
"id": 1,
"type": "string",
"amount": "string",
"create_time": 1752984000,
"pay_time": 1752984000,
"status": "Active",
"gateway": "credit",
"credit": "string",
"client_id": 1,
"client_name": "示例名称",
"notes": "示例说明",
"refund_amount": "string",
"amount_unpaid": "string",
"refundable_amount": "string",
"apply_credit_amount": "string",
"admin_id": 1,
"admin_name": "示例名称",
"is_recycle": 1,
"refund_orginal": 1,
"voucher": [
"string"
],
"review_fail_reason": "示例说明",
"refund_credit": "string",
"refund_gateway": "credit",
"gateway_sign": "example-token",
"unpaid_timeout": 1752984000,
"remain_pay_time": 1752984000,
"items": [
{
"id": 1,
"description": "192.0.2.1",
"amount": "string",
"host_id": 1,
"product_name": "示例名称",
"host_name": "示例名称",
"billing_cycle": "monthly",
"host_status": "Active",
"edit": 1,
"profit": "string",
"agent": 1
}
]
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |