新增
This commit is contained in:
@@ -150,7 +150,7 @@ class FirstVisitDoctorDashboardLogic
|
||||
{
|
||||
$today = date('Y-m-d');
|
||||
$type = (string) ($params['time_type'] ?? 'month');
|
||||
if (!in_array($type, ['today', 'week', 'month', 'custom'], true)) {
|
||||
if (!in_array($type, ['today', 'yesterday', 'week', 'month', 'custom'], true)) {
|
||||
$type = 'month';
|
||||
}
|
||||
|
||||
@@ -175,6 +175,11 @@ class FirstVisitDoctorDashboardLogic
|
||||
if ($type === 'today') {
|
||||
return ['type' => 'today', 'label' => '今日', 'start' => $today, 'end' => $today];
|
||||
}
|
||||
if ($type === 'yesterday') {
|
||||
$yesterday = date('Y-m-d', strtotime('-1 day'));
|
||||
|
||||
return ['type' => 'yesterday', 'label' => '昨天', 'start' => $yesterday, 'end' => $yesterday];
|
||||
}
|
||||
if ($type === 'week') {
|
||||
return [
|
||||
'type' => 'week', 'label' => '本周',
|
||||
|
||||
@@ -146,6 +146,17 @@ class FirstVisitRegistrationStatsLogic
|
||||
$today = date('Y-m-d');
|
||||
$tomorrow = date('Y-m-d', strtotime('+1 day'));
|
||||
$dayAfterTomorrow = date('Y-m-d', strtotime('+2 days'));
|
||||
if ($type === 'yesterday') {
|
||||
$yesterday = date('Y-m-d', strtotime('-1 day'));
|
||||
$dayBefore = date('Y-m-d', strtotime('-2 days'));
|
||||
|
||||
return [
|
||||
'type' => 'yesterday', 'label' => '昨天', 'start' => $yesterday, 'end' => $yesterday,
|
||||
'compare_start' => $dayBefore,
|
||||
'compare_end' => $dayBefore,
|
||||
'tomorrow' => $tomorrow, 'day_after_tomorrow' => $dayAfterTomorrow,
|
||||
];
|
||||
}
|
||||
if ($type === 'week') {
|
||||
$start = date('Y-m-d', strtotime('monday this week'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user