更新
This commit is contained in:
@@ -164,6 +164,21 @@ final class AssistantServiceAlert
|
||||
'scan' => self::scanStatus(), 'coverage' => self::coverage(), 'empty_reason' => ''];
|
||||
if (!$page['schema_ready']) { return $page; }
|
||||
$base = self::scoped($adminId, $actor);
|
||||
if (!empty($p['assistant_id'])) {
|
||||
$aid = (int) $p['assistant_id'];
|
||||
$patientSql = Db::name('tcm_diagnosis')
|
||||
->alias('d')
|
||||
->whereNull('d.delete_time')
|
||||
->where('d.status', 1)
|
||||
->where('d.assistant_id', $aid)
|
||||
->distinct(true)
|
||||
->field('d.patient_id')
|
||||
->buildSql();
|
||||
$base->where(static function ($nested) use ($aid, $patientSql): void {
|
||||
$nested->where('a.staff_admin_id', $aid)
|
||||
->whereOrRaw('a.patient_id IN ' . $patientSql);
|
||||
});
|
||||
}
|
||||
$page['summary'] = [
|
||||
'open' => self::count(clone $base, ['a.status' => 'open']),
|
||||
'high_open' => self::count(clone $base, ['a.status' => 'open', 'a.severity' => 'high']),
|
||||
|
||||
Reference in New Issue
Block a user