更新
This commit is contained in:
@@ -43,6 +43,30 @@ class ChatNotifyLogic extends BaseLogic
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 患者离开会话页/诊室时通知医生端(管理后台轮询)
|
||||
*/
|
||||
public static function addPatientLeftNotify(int $doctorId, string $patientId, string $patientName): bool
|
||||
{
|
||||
$key = self::CACHE_PREFIX . $doctorId;
|
||||
$item = [
|
||||
'id' => uniqid('', true),
|
||||
'type' => 'patient_left_chat',
|
||||
'doctor_id' => $doctorId,
|
||||
'patient_id' => $patientId,
|
||||
'patient_name' => $patientName,
|
||||
'created_at' => time(),
|
||||
];
|
||||
$list = Cache::get($key) ?: [];
|
||||
if (!is_array($list)) {
|
||||
$list = [];
|
||||
}
|
||||
array_unshift($list, $item);
|
||||
$list = array_slice($list, 0, self::MAX_PER_DOCTOR);
|
||||
Cache::set($key, $list, self::CACHE_TTL);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加面诊结束通知(医生完成接诊后通知对应医助)
|
||||
* @param int $assistantId 医助ID (admin_id)
|
||||
|
||||
Reference in New Issue
Block a user