智简魔方文档

记录短信日志

方法概览

项目内容
文档类型PHP 类方法
方法标识app\admin\model\SmsLogModel::createSmsLog
所属业务消息通知
来源模块/系统短信日志模型

功能说明

记录短信日志

调用示例

$phone_code = 86;
$phone = '13800138000';
$template_code = '123456';
$content = 'string';
$status = 1;
$fail_reason = '示例说明';
$rel_id = 0;
$type = 'client';
$ip = '192.0.2.1';
$port = 1;
$result = (new \app\admin\model\SmsLogModel())->createSmsLog($phone_code, $phone, $template_code, $content, $status, $fail_reason, $rel_id, $type, $ip, $port);

参数

参数类型必填默认值校验规则说明
phone_codeint86国际区号
phonestring手机号
template_codestring模板标识
contentstring模板内容
statusintrequire发送状态(1=成功,0=失败)
fail_reasonstring失败原因
rel_idint0关联ID
typestringclient关联类型(client=客户,admin=管理员)
ipstring自动获取 IP
portint自动获取 端口号

返回值

未声明固定返回值。

正常返回

{}

异常情况

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