master
cody 1 week ago
parent 591d2fb5ba
commit 6ce4dc1611

@ -9,6 +9,7 @@ use App\Helpers\StarterResponseCode;
use App\Models\Course;
use App\Models\CourseAppointmentTotal;
use App\Models\CourseSign;
use App\Models\CourseType;
use App\Models\CustomForm;
use App\Models\CustomFormField;
use App\Models\User;
@ -371,13 +372,13 @@ class UserController extends BaseController
return Excel::download(new CommonExport($list, $all['export_fields'] ?? ''), $all['file_name'] ?? '' . date('YmdHis') . '.xlsx');
} else {
// 累计总数
$total = CourseSign::courseSignsTotalByUnique('2020-01-01', date('Y-m-d'));
$total = CourseSign::courseSignsTotalByUnique(CourseType::START_DATE, date('Y-m-d'));
// 报名人数
$year_total = CourseSign::courseSignsTotalByUnique($start_date, $end_date);
// 年度培养学员
$year_training_total = CourseSign::courseSignsTotalByUnique($start_date, $end_date, 1);
// 累计培养学员
$training_total = CourseSign::courseSignsTotalByUnique('2020-01-01', date('Y-m-d'), 1);
$training_total = CourseSign::courseSignsTotalByUnique(CourseType::START_DATE, date('Y-m-d'), 1);
$list = $list->paginate($all['page_size'] ?? 20);
}
return $this->success(['list' => $list, 'year_total' => $year_total, 'total' => $total, 'year_training_total' => $year_training_total, 'training_total' => $training_total]);

Loading…
Cancel
Save