hospital-applets-api/app/Model/OrderPrescriptionFile.php
2023-04-20 13:16:52 +08:00

97 lines
3.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
declare(strict_types=1);
namespace App\Model;
use Hyperf\Database\Model\Builder;
use Hyperf\Database\Model\Collection;
use Hyperf\Snowflake\Concern\Snowflake;
/**
* @property int $prescription_file_id 主键id
* @property int $order_prescription_id 订单-处方id
* @property string $doctor_ca_file_id 医生签章pdf文件id可请求ca下载
* @property string $doctor_pdf_oss_path 医生签章pdf文件oss路径null表示未下载
* @property int $doctor_pdf_down_status 签章文件下载状态0:未下载 1:已下载 2:下载失败)
* @property string $doctor_pdf_down_fail_reason 下载失败原因
* @property string $doctor_img_oss_path 医生签章img文件oss路径
* @property string $hospital_ca_file_id 医院签章pdf文件id可请求ca下载
* @property string $hospital_pdf_oss_path 医院签章pdf文件oss路径null表示未下载
* @property int $hospital_pdf_down_status 签章文件下载状态0:未下载 1:已下载 2:下载失败)
* @property string $hospital_pdf_down_fail_reason 下载失败原因
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
*/
class OrderPrescriptionFile extends Model
{
use Snowflake;
/**
* The table associated with the model.
*/
protected ?string $table = 'order_prescription_file';
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['prescription_file_id', 'order_prescription_id', 'doctor_ca_file_id', 'doctor_pdf_oss_path', 'doctor_pdf_down_status', 'doctor_pdf_down_fail_reason', 'doctor_img_oss_path', 'hospital_ca_file_id', 'hospital_pdf_oss_path', 'hospital_pdf_down_status', 'hospital_pdf_down_fail_reason', 'created_at', 'updated_at'];
protected string $primaryKey = "prescription_file_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
* @return Builder[]|Collection
*/
public static function getList(array $params = [], array $fields = ['*']): Collection|array
{
return self::where($params)->get($fields);
}
/**
* 获取是否存在
* @param array $params
* @return bool
*/
public static function getExists(array $params): bool
{
return self::where($params)->exists();
}
/**
* 修改
* @param array $params
* @param array $data
* @return int
*/
public static function edit(array $params = [], array $data = []): int
{
return self::where($params)->update($data);
}
/**
* 新增
* @param array $data
* @return \Hyperf\Database\Model\Model|OrderPrescriptionFile
*/
public static function addOrderPrescriptionFile(array $data): \Hyperf\Database\Model\Model|OrderPrescriptionFile
{
return self::create($data);
}
}