Files
hospital-applets-api/app/Model/LogSms.php
T
2023-03-22 15:15:33 +08:00

73 lines
1.8 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Model;
use Hyperf\Snowflake\Concern\Snowflake;
/**
* @property int $code_log_id 主键id
* @property int $type 类型(1:短信 2:邮件)
* @property int $status 状态(1:发送成功 2:发送失败)
* @property int $scene 场景(1:登陆)
* @property string $phone 手机号
* @property string $code 验证码
* @property string $third_code 第三方编码
* @property string $remarks 备注
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
*/
class LogSms extends Model
{
use Snowflake;
/**
* The table associated with the model.
*/
protected ?string $table = 'log_sms';
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['log_id', 'type', 'status', 'phone', 'template_code', 'third_code', 'scene_desc', 'remarks', 'created_at', 'updated_at'];
protected string $primaryKey = "log_id";
/**
* 获取信息-单条
* @param array $params
* @param array $fields
* @return object|null
*/
public static function getOne(array $params, array $fields = ['*']): object|null
{
return self::where($params)->first($fields);
}
/**
* 获取信息-多条
* @param array $params
* @param array $fields
* @param string $order
* @param string $direction
* @return object|null
*/
public static function getList(array $params, array $fields = ['*']): object|null
{
return self::where($params)->get($fields);
}
/**
* 新增-批量
* @param array $data
* @return \Hyperf\Database\Model\Model|LogSms
*/
public static function LogSms(array $data): \Hyperf\Database\Model\Model|LogSms
{
return self::create($data);
}
}