产品列表
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\common\model\HostModel::hostList |
| 所属业务 | 产品管理 |
| 来源模块/系统 | 产品模型 |
功能说明
产品列表
调用示例
$param = ['keywords' => '示例关键字', 'billing_cycle' => 'monthly', 'client_id' => 1, 'status' => 'Active', 'due_time' => 'string', 'start_time' => 1752984000, 'end_time' => 1752984000, 'product_id' => 1, 'name' => '示例名称', 'username' => '示例名称', 'email' => 'user@example.com', 'phone' => '13800138000', 'server_id' => 1, 'first_payment_amount' => 'string', 'ip' => '192.0.2.1', 'tab' => 'string', 'view_id' => 1, 'page' => 1, 'limit' => 1, 'orderby' => 'id', 'sort' => 'string'];
$module = 'string';
$result = (new \app\common\model\HostModel())->hostList($param, $module);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
param.keywords | string | 否 | — | — | 关键字,搜索范围:产品ID,商品名称,标识,用户名,邮箱,手机号 |
param.billing_cycle | string | 否 | — | — | 付款周期 |
param.client_id | int | 否 | — | — | 用户ID |
param.status | string | 否 | — | — | 状态Unpaid未付款Pending开通中Active已开通Suspended已暂停Deleted已删除Failed开通失败 |
param.due_time | string | 否 | — | — | 到期时间(today=今天内three=最近三天seven=最近七天month=最近一个月custom=自定义expired=已到期) |
param.start_time | int | 否 | — | — | 开始时间 |
param.end_time | int | 否 | — | — | 结束时间 |
param.product_id | int | 否 | — | — | 商品ID |
param.name | string | 否 | — | — | 标识 |
param.username | string | 否 | — | — | 用户名 |
param.email | string | 否 | — | — | 邮箱 |
param.phone | string | 否 | — | — | 手机号 |
param.server_id | int | 否 | — | — | 接口ID |
param.first_payment_amount | string | 否 | — | — | 订购金额 |
param.ip | string | 否 | — | — | IP |
param.tab | string | 否 | — | — | 状态using使用中expiring即将到期overdue已逾期deleted已删除 |
param.view_id | int | 否 | — | — | 视图ID |
param.page | int | 否 | — | — | 页数 |
param.limit | int | 否 | — | — | 每页条数 |
param.orderby | string | 否 | id | — | 排序(id,renew_amount,due_time,first_payment_amount,active_time,client_id,reg_time) |
param.sort | string | 否 | — | — | 升/降序 asc,desc |
module | string | 否 | — | — | 搜索:模块 |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
list | array | 产品 |
list[].id | int | 产品ID |
list[].client_id | int | 用户ID |
list[].client_name | int | 用户名 |
list[].email | string | 邮箱 |
list[].phone_code | string | 国际电话区号 |
list[].phone | string | 手机号 |
list[].company | string | 公司 |
list[].product_id | int | 商品ID |
list[].product_name | string | 商品名称 |
list[].name | string | 标识 |
list[].active_time | int | 开通时间 |
list[].due_time | int | 到期时间 |
list[].first_payment_amount | string | 金额 |
list[].billing_cycle | string | 周期 |
list[].status | string | 状态Unpaid未付款Pending开通中Active已开通Suspended已暂停Deleted已删除Failed开通失败 |
list[].renew_amount | string | 续费金额 |
list[].client_notes | string | 用户备注 |
list[].ip_num | int | IP数量 |
list[].dedicate_ip | string | 主IP |
list[].assign_ip | string | 附加IP(英文逗号分隔) |
list[].server_name | string | 商品接口,前台接口调用时不返回 |
list[].admin_notes | string | 管理员备注,前台接口调用时不返回 |
list[].base_price | string | 当前周期原价,前台接口调用时不返回 |
list[].client_status | int | 用户是否启用0:禁用,1:正常,前台接口调用时不返回 |
list[].reg_time | int | 用户注册时间,前台接口调用时不返回 |
list[].country | string | 国家,前台接口调用时不返回 |
list[].address | string | 地址,前台接口调用时不返回 |
list[].language | string | 语言,前台接口调用时不返回 |
list[].notes | string | 备注,前台接口调用时不返回 |
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[].self_defined_field_[id] | string | 商品自定义字段(显示字段有self_defined_field_[id]返回,[id]为商品自定义字段ID) |
list[].base_info | string | 产品基础信息 |
count | int | 产品总数 |
using_count | int | 使用中产品数量 |
expiring_count | int | 即将到期产品数量 |
overdue_count | int | 已逾期产品数量 |
deleted_count | int | 已删除产品数量 |
all_count | int | 全部产品数量 |
total_renew_amount | string | 总续费金额 |
page_total_renew_amount | string | 当前页总续费金额 |
failed_action_count | int | 手动处理产品数量 |
正常返回
{
"list": [
{
"id": 1,
"client_id": 1,
"client_name": 1,
"email": "user@example.com",
"phone_code": "86",
"phone": "13800138000",
"company": "string",
"product_id": 1,
"product_name": "示例名称",
"name": "示例名称",
"active_time": 1752984000,
"due_time": 1752984000,
"first_payment_amount": "string",
"billing_cycle": "monthly",
"status": "Active",
"renew_amount": "string",
"client_notes": "示例说明",
"ip_num": 1,
"dedicate_ip": "192.0.2.1",
"assign_ip": "example-token",
"server_name": "示例名称",
"admin_notes": "示例说明",
"base_price": "string",
"client_status": 1,
"reg_time": 1752984000,
"country": "string",
"address": "string",
"language": "zh-cn",
"notes": "示例说明",
"certification": true,
"certification_type": "string",
"client_level": "string",
"client_level_color": "string",
"sale": "string",
"addon_client_custom_field_[id]": "string",
"self_defined_field_[id]": "string",
"base_info": "string"
}
],
"count": 1,
"using_count": 1,
"expiring_count": 1,
"overdue_count": 1,
"deleted_count": 1,
"all_count": 1,
"total_renew_amount": "string",
"page_total_renew_amount": "string",
"failed_action_count": 1
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |