商品详情
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\common\model\UpstreamProductModel::indexProduct |
| 所属业务 | 上下游 |
| 来源模块/系统 | 上游商品模型 |
功能说明
商品详情
调用示例
$id = 1;
$result = (new \app\common\model\UpstreamProductModel())->indexProduct($id);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
id | int | 是 | — | required | 商品ID |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
id | int | 商品ID |
name | string | 商品名称 |
description | string | 商品描述 |
supplier_id | int | 供应商ID |
supplier_name | string | 供应商名称 |
profit_percent | string | 利润百分比 |
profit_type | int | 利润方式0百分比1固定金额 |
auto_setup | int | 是否自动开通:1是,0否 |
hidden | int | 0显示,1隐藏 |
pay_type | string | 付款类型,免费free,一次onetime,周期先付recurring_prepayment,周期后付recurring_postpaid |
price | string | 商品最低价格 |
cycle | string | 商品最低周期 |
upstream_product_id | int | 上游商品ID |
certification | int | 本地实名购买0关闭,1开启 |
product_group_name_second | string | 二级分组名称 |
product_group_id_second | int | 二级分组ID |
product_group_name_first | string | 一级分组名称 |
product_group_id_first | int | 一级分组ID |
need_manual_sync | int | 需要手动同步资源(0=否1=是) |
正常返回
{
"id": 1,
"name": "示例名称",
"description": "192.0.2.1",
"supplier_id": 1,
"supplier_name": "示例名称",
"profit_percent": "string",
"profit_type": 1,
"auto_setup": 1,
"hidden": 1,
"pay_type": "string",
"price": "string",
"cycle": "monthly",
"upstream_product_id": 1,
"certification": 1,
"product_group_name_second": "示例名称",
"product_group_id_second": 1,
"product_group_name_first": "示例名称",
"product_group_id_first": 1,
"need_manual_sync": 1
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |