云服务器商品列表
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\common\model\CloudServerProductModel::productList |
| 所属业务 | 商品管理 |
| 来源模块/系统 | 模板控制器 |
功能说明
云服务器商品列表
调用示例
$param = ['page' => 1, 'limit' => 1, 'orderby' => 'id', 'sort' => 'string'];
$result = (new \app\common\model\CloudServerProductModel())->productList($param);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
param.page | int | 否 | — | — | 页数 |
param.limit | int | 否 | — | — | 每页条数 |
param.orderby | string | 否 | — | — | 排序 id |
param.sort | string | 否 | — | — | 升/降序 asc,desc |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
list | array | 商品 |
list[].id | int | 商品ID |
list[].area_id | int | 区域ID |
list[].first_area | string | 一级区域 |
list[].second_area | string | 二级区域 |
list[].title | string | 标题 |
list[].description | string | 描述 |
list[].cpu | string | 处理器 |
list[].memory | string | 内存 |
list[].system_disk | string | 系统盘 |
list[].bandwidth | string | 带宽 |
list[].duration | string | 时长 |
list[].tag | string | 标签 |
list[].original_price | string | 原价 |
list[].original_price_unit | string | 原价单位,month月year年 |
list[].selling_price | string | 售价 |
list[].selling_price_unit | string | 售价单位,month月year年 |
list[].product_id | int | 关联商品ID |
count | int | 商品数量 |
正常返回
{
"list": [
{
"id": 1,
"area_id": 1,
"first_area": "string",
"second_area": "string",
"title": "示例名称",
"description": "192.0.2.1",
"cpu": "string",
"memory": "string",
"system_disk": "string",
"bandwidth": "string",
"duration": "string",
"tag": "string",
"original_price": "string",
"original_price_unit": "string",
"selling_price": "string",
"selling_price_unit": "string",
"product_id": 1
}
],
"count": 1
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |