医生简介
This commit is contained in:
@@ -11,7 +11,7 @@ use Hyperf\Snowflake\Concern\Snowflake;
|
||||
/**
|
||||
* @property int $record_id 主键id
|
||||
* @property int $doctor_id 医生id
|
||||
* @property int $is_verified 是否已审核(0:否 1:是)
|
||||
* @property int $introduction_status 个人简介审核状态(0:未审核 1:审核通过 2:审核中 3:审核失败)
|
||||
* @property string $avatar 头像
|
||||
* @property string $be_good_at 擅长
|
||||
* @property string $brief_introduction 医生简介
|
||||
@@ -31,7 +31,7 @@ class DoctorIntroductionRecord extends Model
|
||||
/**
|
||||
* 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 array $fillable = ['record_id', 'doctor_id', 'introduction_status', 'avatar', 'be_good_at', 'brief_introduction', 'expertise_ids', 'created_at', 'updated_at'];
|
||||
|
||||
protected string $primaryKey = "record_id";
|
||||
|
||||
@@ -66,4 +66,31 @@ class DoctorIntroductionRecord extends Model
|
||||
{
|
||||
return self::create($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取信息-单条
|
||||
* @param array $params
|
||||
* @param array $fields
|
||||
* @return object|null
|
||||
*/
|
||||
public static function getLastOne(array $params, array $fields = ['*']): object|null
|
||||
{
|
||||
return self::where($params)->latest()->first($fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取某种状态的最后一条数据
|
||||
* @param array $params
|
||||
* @param array $introduction_status
|
||||
* @param array $fields
|
||||
* @return object|null
|
||||
*/
|
||||
public static function getStatusLastOne(array $params, array $introduction_status,array $fields = ["*"]): object|null
|
||||
{
|
||||
return self::where($params)
|
||||
->whereIn("introduction_status", $introduction_status)
|
||||
->latest()
|
||||
->first($fields);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user