商品列表
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\common\model\UpstreamProductModel::productList |
| 所属业务 | 上下游 |
| 来源模块/系统 | 上游商品模型 |
功能说明
商品列表
调用示例
$param = ['keywords' => '示例关键字', 'supplier_id' => 1, 'page' => 1, 'limit' => 1, 'orderby' => 'id', 'sort' => 'string'];
$result = (new \app\common\model\UpstreamProductModel())->productList($param);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
param.keywords | string | 否 | — | — | 关键字,搜索范围:商品名称 |
param.supplier_id | int | 否 | — | — | 供应商ID |
param.page | int | 否 | — | — | 页数 |
param.limit | int | 否 | — | — | 每页条数 |
param.orderby | string | 否 | — | — | 排序 id |
param.sort | string | 否 | — | — | 升/降序 asc,desc |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
list | array | 商品 |
list[].id | int | 商品ID |
list[].name | string | 商品名称 |
list[].description | string | 商品描述 |
list[].supplier_id | int | 供应商ID |
list[].supplier_name | string | 供应商名称 |
list[].profit_type | int | 利润方式0百分比1固定金额 |
list[].profit_percent | string | 利润百分比 |
list[].auto_setup | int | 是否自动开通:1是,0否 |
list[].hidden | int | 0显示,1隐藏 |
list[].pay_type | string | 付款类型,免费free,一次onetime,周期先付recurring_prepayment,周期后付recurring_postpaid |
list[].price | string | 商品最低价格 |
list[].cycle | string | 商品最低周期 |
list[].upstream_product_id | int | 上游商品ID |
list[].certification | int | 本地实名购买0关闭,1开启 |
list[].product_group_name_second | string | 二级分组名称 |
list[].product_group_id_second | int | 二级分组ID |
list[].product_group_name_first | string | 一级分组名称 |
list[].product_group_id_first | int | 一级分组ID |
list[].renew_profit_percent | int | 续费利润百分比或固定金额 |
list[].renew_profit_type | int | 续费利润方式,0百分比,1固定金额 |
list[].upgrade_profit_percent | int | 升降级利润百分比或固定金额 |
list[].upgrade_profit_type | int | 升降级利润方式,0百分比,1固定金额 |
list[].sync | int | 是否同步 商品的可升降级商品 |
list[].mode | string | 代理模式:only_api仅调用接口,sync同步商品 |
list[].need_manual_sync | int | 需要手动同步资源(0=否1=是) |
count | int | 商品总数 |
正常返回
{
"list": [
{
"id": 1,
"name": "示例名称",
"description": "192.0.2.1",
"supplier_id": 1,
"supplier_name": "示例名称",
"profit_type": 1,
"profit_percent": "string",
"auto_setup": 1,
"hidden": 1,
"pay_type": "string",
"price": "string",
"cycle": "string",
"upstream_product_id": 1,
"certification": 1,
"product_group_name_second": "示例名称",
"product_group_id_second": 1,
"product_group_name_first": "示例名称",
"product_group_id_first": 1,
"renew_profit_percent": 1,
"renew_profit_type": 1,
"upgrade_profit_percent": 1,
"upgrade_profit_type": 1,
"sync": 1,
"mode": "string",
"need_manual_sync": 1
}
],
"count": 1
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |