智简魔方文档

获取产品相关变量

方法概览

项目内容
文档类型PHP 类方法
方法标识app\common\logic\NoticeTemplateVarLogic::getHostVar
所属业务消息通知
来源模块/系统通知模板变量逻辑

功能说明

获取产品相关变量

调用示例

$param = [['host_id' => 1, 'client_id' => 1]];
$result = (new \app\common\logic\NoticeTemplateVarLogic())->getHostVar($param);

参数

参数类型必填默认值校验规则说明
paramarray参数
param.host_idintrequire产品ID
param.client_idint用户ID

返回值

返回项类型说明
product_idstring产品ID
product_namestring商品名称-产品标识
product_marker_namestring产品标识
product_first_payment_amountstring订购金额
product_renew_amountstring续费金额
product_billing_cyclestring计费周期
product_active_timestring开通时间
product_due_timestring到期时间
product_suspend_reasonstring暂停原因
renewal_firststringX天后到期第一次续费提醒
renewal_secondstringX天后到期第二次续费提醒
dedicate_ipstring主IP
product_usernamestring产品用户名(远程用户名)
product_passwordstring产品密码(远程密码)
product_portstring产品端口
productstring商品名称
host_order_amountstring实际订购金额

正常返回

{
  "product_id": "1",
  "product_name": "示例名称",
  "product_marker_name": "示例名称",
  "product_first_payment_amount": "string",
  "product_renew_amount": "string",
  "product_billing_cycle": "monthly",
  "product_active_time": "string",
  "product_due_time": "string",
  "product_suspend_reason": "示例说明",
  "renewal_first": "string",
  "renewal_second": "string",
  "dedicate_ip": "192.0.2.1",
  "product_username": "示例名称",
  "product_password": "Example@123",
  "product_port": "string",
  "product": "string",
  "host_order_amount": "string"
}

异常情况

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