智简魔方文档

推荐代理商品列表

方法概览

项目内容
文档类型PHP 类方法
方法标识app\common\logic\UpstreamLogic::recommendProductList
所属业务上下游
来源模块/系统上游管理公共类

功能说明

推荐代理商品列表

调用示例

$param = ['keywords' => '示例关键字', 'page' => 1, 'limit' => 1, 'orderby' => 'id', 'sort' => 'string'];
$result = (new \app\common\logic\UpstreamLogic())->recommendProductList($param);

参数

参数类型必填默认值校验规则说明
param.keywordsstring关键字,搜索范围:商品名称
param.pageint页数
param.limitint每页条数
param.orderbystring排序 id
param.sortstring升/降序 asc,desc

返回值

返回项类型说明
listarray推荐商品
list[].idint推荐商品ID
list[].upstream_product_idint上游商品ID
list[].namestring商品名称
list[].typestring供应商类型default默认业务系统whmcs财务系统finance魔方财务
list[].supplier_namestring供应商名称
list[].login_urlstring前台网站地址
list[].urlstring接口地址
list[].pay_typestring付款类型,免费free,一次onetime,周期先付recurring_prepayment,周期后付recurring_postpaid
list[].pricestring商品最低价格
list[].cyclestring商品最低周期
list[].cpu_minintCPU(核)最小值
list[].cpu_maxintCPU(核)最大值
list[].memory_minint内存(GB)最小值
list[].memory_maxint内存(GB)最大值
list[].disk_minint硬盘(GB)最小值
list[].disk_maxint硬盘(GB)最大值
list[].bandwidth_minint带宽(Mbps)最小值
list[].bandwidth_maxint带宽(Mbps)最大值
list[].flow_minint流量(G)最小值
list[].flow_maxint流量(G)最大值
list[].descriptionstring简介
list[].agentint是否已代理0否1是
list[].supplierobject供应商,已添加时有数据
list[].supplier.idobject供应商ID
list[].supplier.usernameobject上游账户名
list[].supplier.tokenobjectAPI密钥
list[].supplier.secretobjectAPI私钥
countint推荐商品总数

正常返回

{
  "list": [
    {
      "id": 1,
      "upstream_product_id": 1,
      "name": "示例名称",
      "type": "string",
      "supplier_name": "示例名称",
      "login_url": "https://example.com/callback",
      "url": "https://example.com/callback",
      "pay_type": "string",
      "price": "string",
      "cycle": "string",
      "cpu_min": 1,
      "cpu_max": 1,
      "memory_min": 1,
      "memory_max": 1,
      "disk_min": 1,
      "disk_max": 1,
      "bandwidth_min": 1,
      "bandwidth_max": 1,
      "flow_min": 1,
      "flow_max": 1,
      "description": "192.0.2.1",
      "agent": 1,
      "supplier": {
        "id": {},
        "username": {},
        "token": {},
        "secret": {}
      }
    }
  ],
  "count": 1
}

异常情况

异常类型说明
Throwable调用失败时由具体实现抛出异常,异常信息以运行时结果为准。