更新
This commit is contained in:
@@ -117,6 +117,7 @@ class PrescriptionOrderLists extends BaseAdminDataLists implements ListsSearchIn
|
||||
$this->applyExpressCompanyFilter($query);
|
||||
$this->applyExpressKeywordFilter($query);
|
||||
$this->applyServiceChannelFilter($query);
|
||||
$this->applyShipModeFilter($query);
|
||||
$this->applySupplyModeFilter($query);
|
||||
$this->applyAmountFilter($query);
|
||||
$this->applyHasAuxFormulaFilter($query);
|
||||
@@ -336,6 +337,19 @@ class PrescriptionOrderLists extends BaseAdminDataLists implements ListsSearchIn
|
||||
$query->where('service_channel', '=', $v);
|
||||
}
|
||||
|
||||
/**
|
||||
* 按目标药房筛选,不依赖审核状态或上传结果;历史空值与订单发货逻辑一致,默认甘草。
|
||||
*/
|
||||
private function applyShipModeFilter(Query $query): void
|
||||
{
|
||||
$mode = strtolower(trim((string) ($this->params['ship_mode'] ?? '')));
|
||||
if ($mode === 'gancao') {
|
||||
$query->whereRaw("LOWER(TRIM(IFNULL(`ship_mode`,''))) <> 'direct'");
|
||||
} elseif ($mode === 'direct') {
|
||||
$query->whereRaw("LOWER(TRIM(IFNULL(`ship_mode`,''))) = 'direct'");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 供货方式:洛阳直发(ship_mode=direct,含尚未上传)/ 甘草(有甘草单号)/ 自营(其余)。
|
||||
*
|
||||
@@ -371,16 +385,18 @@ class PrescriptionOrderLists extends BaseAdminDataLists implements ListsSearchIn
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务订单金额上限(不含边界):amount_lt=2000 表示 amount < 2000。
|
||||
* 业务订单金额上限:amount_lte 含边界,amount_lt 不含边界。
|
||||
*/
|
||||
private function applyAmountFilter(Query $query): void
|
||||
{
|
||||
$amount = $this->params['amount_lt'] ?? null;
|
||||
if (!is_numeric($amount) || !is_finite((float) $amount)) {
|
||||
return;
|
||||
}
|
||||
foreach (['amount_lt' => '<', 'amount_lte' => '<='] as $parameter => $operator) {
|
||||
$amount = $this->params[$parameter] ?? null;
|
||||
if (!is_numeric($amount) || !is_finite((float) $amount)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$query->where('amount', '<', (float) $amount);
|
||||
$query->where('amount', $operator, (float) $amount);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -560,6 +576,7 @@ class PrescriptionOrderLists extends BaseAdminDataLists implements ListsSearchIn
|
||||
$this->applyDoctorAssistantFilters($query);
|
||||
$this->applyPatientKeywordFilter($query);
|
||||
$this->applyAuditAdminFilter($query);
|
||||
$this->applyShipModeFilter($query);
|
||||
$this->applySupplyModeFilter($query);
|
||||
$this->applyAmountFilter($query);
|
||||
if ($this->shouldSkipCreatorOnlyForYejiDrawer()) {
|
||||
|
||||
Reference in New Issue
Block a user