用户列表
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\common\model\ClientModel::clientList |
| 所属业务 | 用户管理 |
| 来源模块/系统 | 用户模型 |
功能说明
用户列表
调用示例
$param = ['custom_field' => [], 'type' => 'string', 'keywords' => '示例关键字', 'client_id' => 1, 'client_ids' => [1], 'page' => 1, 'limit' => 1, 'orderby' => 'id', 'sort' => 'string', 'show_sub_client' => 1];
$result = (new \app\common\model\ClientModel())->clientList($param);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
param.custom_field | object | 否 | — | — | 自定义字段,key为自定义字段名称,value为自定义字段的值 |
param.type | string | 否 | — | — | 关键字类型,id用户ID,username姓名,phone手机号,email邮箱,company公司 |
param.keywords | string | 否 | — | — | 关键字,搜索范围随关键字类型变化,默认搜索范围:用户ID,姓名,邮箱,手机号,公司 |
param.client_id | int | 否 | — | — | 用户ID |
param.client_ids | array | 否 | — | — | 用户ID(多个) |
param.page | int | 否 | — | — | 页数 |
param.limit | int | 否 | — | — | 每页条数 |
param.orderby | string | 否 | id | — | 排序(id,reg_time,host_active_num,host_num,credit,cost_price,refund_price,withdraw_price) |
param.sort | string | 否 | — | — | 升/降序 asc,desc |
param.show_sub_client | int | 否 | — | — | 显示子账户(0=隐藏,1=显示) |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
list | array | 用户 |
list[].id | int | 用户ID |
list[].username | string | 姓名 |
list[].email | string | 邮箱 |
list[].phone_code | int | 国际电话区号 |
list[].phone | string | 手机号 |
list[].status | int | 状态;0:禁用,1:正常 |
list[].reg_time | int | 注册时间 |
list[].country | string | 国家 |
list[].address | string | 地址 |
list[].company | string | 公司 |
list[].language | string | 语言 |
list[].notes | string | 备注 |
list[].credit | string | 余额 |
list[].host_num | int | 产品数量 |
list[].host_active_num | int | 已激活产品数量 |
list[].custom_field | array | 自定义字段 |
list[].custom_field[].name | string | 名称 |
list[].custom_field[].value | string | 值 |
list[].cost_price | string | 消费金额 |
list[].certification | bool | 是否实名认证true是false否 |
list[].certification_type | string | 实名类型person个人company企业 |
list[].client_level | string | 用户等级(显示字段有client_level返回) |
list[].client_level_color | string | 用户等级颜色(显示字段有client_level返回) |
list[].sale | string | 销售(显示字段有sale返回) |
list[].oauth | array | 关联的三方登录类型 |
list[].mp_weixin_notice | int | 微信公众号关注状态(0=未关注1=已关注) |
list[].refund_price | string | 退款金额(显示字段有refund_price返回) |
list[].withdraw_price | string | 提现金额(显示字段有withdraw_price返回) |
list[].addon_client_custom_field_[id] | string | 用户自定义字段(显示字段有addon_client_custom_field_[id]返回,[id]为用户自定义字段ID) |
count | int | 用户总数 |
total_credit | string | 总余额 |
page_total_credit | string | 当前页总余额 |
正常返回
{
"list": [
{
"id": 1,
"username": "示例名称",
"email": "user@example.com",
"phone_code": 86,
"phone": "13800138000",
"status": 1,
"reg_time": 1752984000,
"country": "string",
"address": "string",
"company": "string",
"language": "zh-cn",
"notes": "示例说明",
"credit": "string",
"host_num": 1,
"host_active_num": 1,
"custom_field": [
{
"name": "示例名称",
"value": "string"
}
],
"cost_price": "string",
"certification": true,
"certification_type": "string",
"client_level": "string",
"client_level_color": "string",
"sale": "string",
"oauth": [
"string"
],
"mp_weixin_notice": 1,
"refund_price": "string",
"withdraw_price": "string",
"addon_client_custom_field_[id]": "string"
}
],
"count": 1,
"total_credit": "string",
"page_total_credit": "string"
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |