智简魔方文档

商品列表

方法概览

项目内容
文档类型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.keywordsstring关键字,搜索范围:商品名称
param.supplier_idint供应商ID
param.pageint页数
param.limitint每页条数
param.orderbystring排序 id
param.sortstring升/降序 asc,desc

返回值

返回项类型说明
listarray商品
list[].idint商品ID
list[].namestring商品名称
list[].descriptionstring商品描述
list[].supplier_idint供应商ID
list[].supplier_namestring供应商名称
list[].profit_typeint利润方式0百分比1固定金额
list[].profit_percentstring利润百分比
list[].auto_setupint是否自动开通:1是,0否
list[].hiddenint0显示,1隐藏
list[].pay_typestring付款类型,免费free,一次onetime,周期先付recurring_prepayment,周期后付recurring_postpaid
list[].pricestring商品最低价格
list[].cyclestring商品最低周期
list[].upstream_product_idint上游商品ID
list[].certificationint本地实名购买0关闭,1开启
list[].product_group_name_secondstring二级分组名称
list[].product_group_id_secondint二级分组ID
list[].product_group_name_firststring一级分组名称
list[].product_group_id_firstint一级分组ID
list[].renew_profit_percentint续费利润百分比或固定金额
list[].renew_profit_typeint续费利润方式,0百分比,1固定金额
list[].upgrade_profit_percentint升降级利润百分比或固定金额
list[].upgrade_profit_typeint升降级利润方式,0百分比,1固定金额
list[].syncint是否同步 商品的可升降级商品
list[].modestring代理模式:only_api仅调用接口,sync同步商品
list[].need_manual_syncint需要手动同步资源(0=否1=是)
countint商品总数

正常返回

{
  "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调用失败时由具体实现抛出异常,异常信息以运行时结果为准。