Корректировка расчета плана за текущий месяц #3

This commit is contained in:
brusnitsyn
2026-06-06 00:30:22 +09:00
parent 6e0adc56fb
commit 8dda8ee5ac

View File

@@ -49,7 +49,7 @@ class PlanCalculator extends BaseMetricService implements MetricCalculatorInterf
->join('duty_report_metric_results as mr', 'r.id', '=', 'mr.rf_report_id')
->whereIn('r.rf_department_id', $departmentIds)
->where('mr.rf_metrika_item_id', self::getMetricId())
->where('r.period_end', '>=', $startCurrentMonth) // Используем >=
->where('r.period_end', '>', $startCurrentMonth) // Используем >=
->where('r.period_end', '<=', $endDate)
->select('r.rf_department_id', DB::raw('SUM(CAST(mr.value AS DECIMAL)) as total'))
->groupBy('r.rf_department_id')