自定义字段列表
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\common\model\SelfDefinedFieldModel::selfDefinedFieldList |
| 所属业务 | 公共接口 |
| 来源模块/系统 | 自定义字段模型 |
功能说明
自定义字段列表
调用示例
$param = ['type' => 'product', 'relid' => 1];
$result = (new \app\common\model\SelfDefinedFieldModel())->selfDefinedFieldList($param);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
param.type | string | 否 | product | — | 类型(product=商品,product_group商品组) |
param.relid | int | 是 | — | require | 关联ID(商品ID) |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
list[].id | int | 自定义字段ID |
list[].field_name | string | 字段名称 |
list[].is_required | int | 是否必填(0=否,1=是) |
list[].field_type | string | 字段类型(text=文本框,link=链接,password=密码,dropdown=下拉,tickbox=勾选框,textarea=文本区,explain=说明) |
list[].description | string | 字段描述 |
list[].regexpr | string | 验证规则 |
list[].field_option | string | 下拉选项 |
list[].show_order_page | int | 订单页可见(0=否,1=是) |
list[].show_order_detail | int | 订单详情可见(0=否,1=是) |
list[].show_client_host_detail | int | 前台产品详情可见(0=否,1=是) |
list[].show_admin_host_detail | int | 后台产品详情可见(0=否,1=是) |
list[].show_client_host_list | int | 会员中心列表显示(0=否,1=是) |
list[].show_admin_host_list | int | 后台产品列表显示(0=否,1=是) |
list[].upstream_id | int | 上游ID(大于0不能修改删除) |
list[].explain_content | string | 说明内容 |
list[].product_group | array | 关联商品分组,类型为商品组时返回 |
list[].product_group[].id | int | 关联商品分组ID |
list[].product_group[].first_group_name | string | 一级分组名称 |
list[].product_group[].name | string | 关联商品分组名称 |
count | int | 总条数 |
正常返回
{
"list": [
{
"id": 1,
"field_name": "示例名称",
"is_required": 1,
"field_type": "string",
"description": "192.0.2.1",
"regexpr": "string",
"field_option": "string",
"show_order_page": 1,
"show_order_detail": 1,
"show_client_host_detail": 1,
"show_admin_host_detail": 1,
"show_client_host_list": 1,
"show_admin_host_list": 1,
"upstream_id": 1,
"explain_content": "string",
"product_group": [
{
"id": 1,
"first_group_name": "示例名称",
"name": "示例名称"
}
]
}
],
"count": 1
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |