智简魔方文档

计算自动填充

方法概览

项目内容
文档类型PHP 类方法
方法标识app\common\model\ProductDurationRatioModel::autoFill
所属业务公共接口
来源模块/系统周期比例模型

功能说明

计算自动填充

调用示例

$param = [['product_id' => 1, 'price' => ['string'], 'on_demand_price' => 0.01]];
$result = (new \app\common\model\ProductDurationRatioModel())->autoFill($param);

参数

参数类型必填默认值校验规则说明
paramarrayrequire参数
param.product_idintrequire商品ID
param.pricearrayrequire价格(如["2"=>"1.5"],键是周期ID,值是价格)
param.on_demand_pricefloat按需价格

返回值

返回项类型说明
statusint状态(200=成功,400=失败)
msgstring信息
data.listarray填充的价格(键是周期ID,值是填充的价格)
on_demand_pricestring按需价格

正常返回

{
  "status": 1,
  "msg": "string",
  "data": {
    "list": [
      "string"
    ]
  },
  "on_demand_price": "string"
}

异常情况

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