Merge branch 'master' into yeji-5-11
This commit is contained in:
@@ -906,6 +906,24 @@ class PrescriptionOrderLists extends BaseAdminDataLists implements ListsSearchIn
|
||||
|
||||
return;
|
||||
}
|
||||
$yejiTableRowDeptIds = [];
|
||||
if (isset($this->params['yeji_table_row_dept_ids']) && trim((string) $this->params['yeji_table_row_dept_ids']) !== '') {
|
||||
foreach (explode(',', (string) $this->params['yeji_table_row_dept_ids']) as $p) {
|
||||
$v = (int) trim((string) $p);
|
||||
if ($v > 0) {
|
||||
$yejiTableRowDeptIds[] = $v;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((int) ($this->params['yeji_order_drawer'] ?? 0) === 1 && $yejiTableRowDeptIds !== []) {
|
||||
YejiStatsLogic::applyPrescriptionOrderListAlignedWinnerDeptFilter(
|
||||
$query,
|
||||
(int) $this->params['assistant_dept_id'],
|
||||
$yejiTableRowDeptIds
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
$rootDeptId = (int) $this->params['assistant_dept_id'];
|
||||
$deptIds = DeptLogic::getSelfAndDescendantIds($rootDeptId);
|
||||
$deptIds = array_values(array_filter(array_map('intval', $deptIds), static function (int $id): bool {
|
||||
@@ -918,6 +936,7 @@ class PrescriptionOrderLists extends BaseAdminDataLists implements ListsSearchIn
|
||||
}
|
||||
$inList = implode(',', $deptIds);
|
||||
$adTbl = (new AdminDept())->getTable();
|
||||
<<<<<<< HEAD
|
||||
if ($yejiPanel) {
|
||||
/** 业绩看板部门侧栏:仅订单创建人人事部门 ∈ 子树(与「合计业绩」/「接诊诊单」/「复诊」聚合同口径) */
|
||||
$query->whereExists(
|
||||
@@ -936,6 +955,12 @@ class PrescriptionOrderLists extends BaseAdminDataLists implements ListsSearchIn
|
||||
);
|
||||
});
|
||||
}
|
||||
=======
|
||||
$poRef = '`' . str_replace('`', '', $poTbl) . '`';
|
||||
$query->whereRaw(
|
||||
YejiStatsLogic::sqlPrescriptionOrderListDeptSubtreeMatchCreatorFirst($poRef, $diagTbl, $adTbl, $inList)
|
||||
);
|
||||
>>>>>>> master
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user