49 lines
1.2 KiB
PHP
49 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Model;
|
|
|
|
|
|
|
|
use Hyperf\Snowflake\Concern\Snowflake;
|
|
|
|
/**
|
|
* @property int $patient_follow_id 主键id
|
|
* @property int $patient_id 患者id
|
|
* @property int $doctor_id 医生id
|
|
* @property \Carbon\Carbon $created_at 创建时间
|
|
* @property \Carbon\Carbon $updated_at 修改时间
|
|
*/
|
|
class PatientFollow extends Model
|
|
{
|
|
use Snowflake;
|
|
|
|
/**
|
|
* The table associated with the model.
|
|
*/
|
|
protected ?string $table = 'patient_follow';
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*/
|
|
protected array $fillable = ['patient_follow_id', 'patient_id', 'doctor_id', 'created_at', 'updated_at'];
|
|
|
|
/**
|
|
* The attributes that should be cast to native types.
|
|
*/
|
|
protected array $casts = ['patient_follow_id' => 'integer', 'patient_id' => 'integer', 'doctor_id' => 'integer', 'created_at' => 'datetime', 'updated_at' => 'datetime'];
|
|
|
|
protected string $primaryKey = "patient_follow_id";
|
|
|
|
/**
|
|
* 获取是否存在
|
|
* @param array $params
|
|
* @return bool
|
|
*/
|
|
public static function getExists(array $params): bool
|
|
{
|
|
return self::where($params)->exists();
|
|
}
|
|
}
|