更新
This commit is contained in:
@@ -70,6 +70,25 @@ class PrescriptionLists extends BaseAdminDataLists implements ListsSearchInterfa
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 来源:system=系统代开(is_system_auto=1),manual=手工(0 或空)
|
||||
*/
|
||||
private function applySourceFilter($query): void
|
||||
{
|
||||
$sf = (string) ($this->params['source_filter'] ?? '');
|
||||
if ($sf === '' || $sf === 'all') {
|
||||
return;
|
||||
}
|
||||
if ($sf === 'system') {
|
||||
$query->where('is_system_auto', 1);
|
||||
|
||||
return;
|
||||
}
|
||||
if ($sf === 'manual') {
|
||||
$query->where('is_system_auto', 0);
|
||||
}
|
||||
}
|
||||
|
||||
private function applyVisibilityScope($query): void
|
||||
{
|
||||
$query->where(function ($query) {
|
||||
@@ -116,6 +135,7 @@ class PrescriptionLists extends BaseAdminDataLists implements ListsSearchInterfa
|
||||
{
|
||||
$query = Prescription::where($this->searchWhere);
|
||||
$this->applyAuditFilter($query);
|
||||
$this->applySourceFilter($query);
|
||||
$this->applyVisibilityScope($query);
|
||||
$this->applyCreatorIdsFilter($query);
|
||||
|
||||
@@ -208,6 +228,7 @@ class PrescriptionLists extends BaseAdminDataLists implements ListsSearchInterfa
|
||||
{
|
||||
$query = Prescription::where($this->searchWhere);
|
||||
$this->applyAuditFilter($query);
|
||||
$this->applySourceFilter($query);
|
||||
$this->applyVisibilityScope($query);
|
||||
$this->applyCreatorIdsFilter($query);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user