This commit is contained in:
Your Name
2026-08-06 10:57:35 +08:00
parent 2c0b9c5afa
commit 079e50006d
400 changed files with 3046 additions and 714 deletions
@@ -6,6 +6,7 @@ namespace app\adminapi\logic\firstvisit;
use app\adminapi\logic\dept\DeptLogic;
use app\adminapi\logic\stats\ConversionLogic;
use app\adminapi\logic\stats\YejiStatsLogic;
use app\common\model\auth\Admin;
use app\common\model\auth\AdminDept;
use app\common\model\stats\PersonalYeji;
@@ -156,10 +157,15 @@ class FirstVisitConversionLogic
private static function resolveTimeRange(string $timeType): array
{
$today = date('Y-m-d');
$timeType = in_array($timeType, ['today', 'week', 'month', 'quarter', 'year'], true)
$timeType = in_array($timeType, ['today', 'yesterday', 'week', 'month', 'quarter', 'year'], true)
? $timeType
: 'today';
if ($timeType === 'yesterday') {
$yesterday = date('Y-m-d', strtotime('-1 day'));
return [$yesterday, $yesterday, $timeType, '昨天'];
}
if ($timeType === 'week') {
return [date('Y-m-d', strtotime('monday this week')), $today, $timeType, '本周'];
}
@@ -451,6 +457,7 @@ class FirstVisitConversionLogic
strtotime($year . '-01-01 00:00:00'),
strtotime($year . '-12-31 23:59:59'),
]);
YejiStatsLogic::applyPrescriptionOrderEffectiveAmountQuery($actualQuery, 'po');
if ($effectiveAdminIds !== null) {
$actualQuery->whereIn('rx.assistant_id', $effectiveAdminIds);
}