新增查看患者病例接口
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Model;
|
||||
|
||||
|
||||
|
||||
use Hyperf\Database\Model\Collection;
|
||||
use Hyperf\Snowflake\Concern\Snowflake;
|
||||
|
||||
/**
|
||||
* @property int $family_health_id 主键id
|
||||
* @property int $family_id 家庭成员id
|
||||
* @property int $patient_id 患者id
|
||||
* @property string $disease_name 疾病名称
|
||||
* @property string $diagnosis_date 确诊日期
|
||||
* @property string $diagnosis_hospital 确诊医院
|
||||
* @property string $drugs_name 正在服药名称
|
||||
* @property \Carbon\Carbon $created_at 创建时间
|
||||
* @property \Carbon\Carbon $updated_at 修改时间
|
||||
*/
|
||||
class PatientFamilyHealth extends Model
|
||||
{
|
||||
use Snowflake;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
*/
|
||||
protected ?string $table = 'patient_family_health';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected array $fillable = ['family_health_id', 'family_id', 'patient_id', 'disease_name', 'diagnosis_date', 'diagnosis_hospital', 'drugs_name', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "family_health_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 Collection|array
|
||||
*/
|
||||
public static function getList(array $params = [], array $fields = ['*']): Collection|array
|
||||
{
|
||||
return self::where($params)->get($fields);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user