搜索用户
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\common\model\ClientModel::searchClient |
| 所属业务 | 用户管理 |
| 来源模块/系统 | 用户模型 |
功能说明
搜索用户
调用示例
$param = ['keywords' => '示例关键字'];
$type = 'string';
$result = (new \app\common\model\ClientModel())->searchClient($param, $type);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
param.keywords | string | 否 | — | — | 关键字,搜索范围:用户ID,姓名,邮箱,手机号 |
type | string | 否 | — | — | 搜索类型:global全局搜索 |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
list | array | 用户 |
list[].id | int | 用户ID |
list[].username | string | 姓名 |
list[].company | string | 公司 |
list[].email | string | 邮箱 |
list[].phone_code | string | 国际电话区号 |
list[].phone | string | 手机号 |
正常返回
{
"list": [
{
"id": 1,
"username": "示例名称",
"company": "string",
"email": "user@example.com",
"phone_code": "86",
"phone": "13800138000"
}
]
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |