智简魔方文档

更改用户余额

方法概览

项目内容
文档类型PHP 类方法
方法标识app\common\model\ClientCreditModel::updateClientCredit
所属业务财务管理
来源模块/系统用户余额管理模型

功能说明

更改用户余额

调用示例

$param = ['id' => 1, 'type' => 'string', 'amount' => 0.01, 'notes' => '示例说明', 'order_id' => 1, 'host_id' => 1];
$result = (new \app\common\model\ClientCreditModel())->updateClientCredit($param);

参数

参数类型必填默认值校验规则说明
param.idintrequired用户ID
param.typestringrequired类型recharge充值deduction扣费
param.amountfloatrequired金额
param.notesstring备注
param.order_idint订单ID
param.host_idint产品ID

返回值

返回项类型说明
statusint状态码,200成功,400失败
msgstring提示信息

正常返回

{
  "status": 1,
  "msg": "string"
}

异常情况

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