编辑商品
方法概览
| 项目 | 内容 |
|---|---|
| 文档类型 | PHP 类方法 |
| 方法标识 | app\common\model\UpstreamProductModel::updateProduct |
| 所属业务 | 上下游 |
| 来源模块/系统 | 上游商品模型 |
功能说明
编辑商品
调用示例
$param = ['id' => 1, 'supplier_id' => 1, 'upstream_product_id' => 1, 'name' => '示例名称', 'description' => '192.0.2.1', 'profit_percent' => 0.01, 'profit_type' => 1, 'auto_setup' => 1, 'certification' => 1, 'product_group_id' => 1, 'sync' => true];
$renew_profit_percent = 0.01;
$renew_profit_type = 1;
$upgrade_profit_percent = 0.01;
$upgrade_profit_type = 1;
$mode = 'string';
$result = (new \app\common\model\UpstreamProductModel())->updateProduct($param, $renew_profit_percent, $renew_profit_type, $upgrade_profit_percent, $upgrade_profit_type, $mode);参数
| 参数 | 类型 | 必填 | 默认值 | 校验规则 | 说明 |
|---|---|---|---|---|---|
param.id | int | 是 | — | required | 商品ID |
param.supplier_id | int | 是 | — | required | 供应商ID |
param.upstream_product_id | int | 是 | — | required | 上游商品ID |
param.name | string | 是 | — | required | 商品名称 |
param.description | string | 否 | — | — | 商品描述 |
param.profit_percent | float | 是 | — | required | 利润百分比 |
param.profit_type | int | 是 | — | required | 利润方式0百分比1固定金额 |
param.auto_setup | int | 是 | — | required | 是否自动开通:1是,0否 |
param.certification | int | 是 | — | required | 本地实名购买0关闭,1开启 |
param.product_group_id | int | 是 | — | required | 二级分组ID |
param.sync | boolean | 是 | — | required | 是否代理升降级商品:0,1 |
renew_profit_percent | float | 是 | — | required | 续费利润百分比 |
renew_profit_type | int | 是 | — | required | 续费利润方式0百分比1固定金额 |
upgrade_profit_percent | float | 是 | — | required | 升降级利润百分比 |
upgrade_profit_type | int | 是 | — | required | 升降级利润方式0百分比1固定金额 |
mode | string | 否 | — | — | 代理模式:only_api仅调用接口,sync同步商品 |
返回值
| 返回项 | 类型 | 说明 |
|---|---|---|
status | int | 状态码,200成功,400失败 |
msg | string | 提示信息 |
正常返回
{
"status": 1,
"msg": "string"
}异常情况
| 异常类型 | 说明 |
|---|---|
Throwable | 调用失败时由具体实现抛出异常,异常信息以运行时结果为准。 |