产品详情
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\common\model\HostModel::indexHost |
| 所属业务 | 产品管理 |
| 来源模块/系统 | 产品模型 |
功能说明
产品详情
调用示例
$id = 1;
$result = (new \app\common\model\HostModel())->indexHost($id);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
id | int | 是 | — | required | 产品ID |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
id | int | 产品ID |
order_id | int | 订单ID |
product_id | int | 商品ID |
server_id | int | 接口ID |
name | string | 标识 |
notes | string | 备注 |
first_payment_amount | string | 订购金额 |
renew_amount | string | 续费金额 |
billing_cycle | string | 计费周期 |
billing_cycle_name | string | 模块计费周期名称 |
billing_cycle_time | string | 模块计费周期时间,秒 |
active_time | int | 开通时间 |
due_time | int | 到期时间 |
status | string | 状态Unpaid未付款Pending开通中Active已开通Suspended已暂停Deleted已删除Failed开通失败 |
suspend_type | string | 暂停类型,overdue到期暂停,overtraffic超流暂停,certification_not_complete实名未完成,other其他 |
suspend_reason | string | 暂停原因 |
client_notes | string | 用户备注 |
ratio_renew | int | 是否开启比例续费:0否,1是 |
base_price | string | 购买周期原价 |
product_name | string | 商品名称 |
agent | int | 代理产品0否1是 |
upstream_host_id | string | 上游产品ID |
mode | string | 商品代理模式:only_api仅调用接口,sync同步商品 |
base_info | string | 产品基础信息 |
auto_release_time | int | 自动释放时间(0=未设置过) |
change_billing_cycle_id | int | 是否申请了到期转按需(0=否,>0是,申请了不能执行续费/升降级操作) |
addition.country_id | int | 国家ID |
addition.city | string | 城市 |
addition.area | string | 区域 |
addition.image_icon | string | 镜像图标(Windows,CentOS,Ubuntu,Debian,ESXi,XenServer,FreeBSD,Fedora,ArchLinux,Rocky,AlmaLinux,OpenEuler,RedHat,其他) |
addition.image_name | string | 镜像名称 |
addition.username | string | 实例用户名 |
addition.password | string | 实例密码 |
addition.port | int | 端口 |
product_on_demand.client_auto_delete | int | 允许用户设置自动释放(0=否,1=是) |
product_on_demand.on_demand_to_duration | int | 允许按需转包年包月(0=否,1=是) |
product_on_demand.duration_to_on_demand | int | 允许包年包月/试用转按需(0=否,1=是) |
正常返回
{
"id": 1,
"order_id": 1,
"product_id": 1,
"server_id": 1,
"name": "示例名称",
"notes": "示例说明",
"first_payment_amount": "string",
"renew_amount": "string",
"billing_cycle": "monthly",
"billing_cycle_name": "monthly",
"billing_cycle_time": "monthly",
"active_time": 1752984000,
"due_time": 1752984000,
"status": "Active",
"suspend_type": "string",
"suspend_reason": "示例说明",
"client_notes": "示例说明",
"ratio_renew": 1,
"base_price": "string",
"product_name": "示例名称",
"agent": 1,
"upstream_host_id": "1",
"mode": "string",
"base_info": "string",
"auto_release_time": 1752984000,
"change_billing_cycle_id": 1,
"addition": {
"country_id": 1,
"city": "string",
"area": "string",
"image_icon": "string",
"image_name": "示例名称",
"username": "示例名称",
"password": "Example@123",
"port": 1
},
"product_on_demand": {
"client_auto_delete": 1,
"on_demand_to_duration": 1,
"duration_to_on_demand": 1
}
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |