Files
hospital-applets-api/app/Model/DoctorIntroductionRecord.php
T
2024-01-19 11:56:34 +08:00

70 lines
1.8 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Model;
use Hyperf\Snowflake\Concern\Snowflake;
/**
* @property int $record_id 主键id
* @property int $doctor_id 医生id
* @property int $is_verified 是否已审核(0:否 1:是)
* @property string $avatar 头像
* @property string $be_good_at 擅长
* @property string $brief_introduction 医生简介
* @property string $expertise_ids 专长id,逗号分隔
* @property \Carbon\Carbon $created_at 创建时间
* @property \Carbon\Carbon $updated_at 修改时间
*/
class DoctorIntroductionRecord extends Model
{
use Snowflake;
/**
* The table associated with the model.
*/
protected ?string $table = 'doctor_introduction_record';
/**
* The attributes that are mass assignable.
*/
protected array $fillable = ['record_id', 'doctor_id', 'is_verified', 'avatar', 'be_good_at', 'brief_introduction', 'expertise_ids', 'created_at', 'updated_at'];
protected string $primaryKey = "record_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 object|null
*/
public static function getList(array $params, array $fields = ['*']): object|null
{
return self::where($params)->get($fields);
}
/**
* 新增
* @param array $data
* @return DoctorIntroductionRecord|\Hyperf\Database\Model\Model
*/
public static function addDoctorIntroductionRecord(array $data): \Hyperf\Database\Model\Model|DoctorIntroductionRecord
{
return self::create($data);
}
}