lion 2 weeks ago
commit 075a7245be

@ -174,6 +174,8 @@ class UserController extends CommonController
$model->password = Hash::make($all['password']);
}
if (isset($all['username']) && !empty($all['username'])) {
// 去除左右两边和中间的空格
$all['username'] = str_replace(' ', '', trim($all['username']));
$all['name'] = $all['username'];
}
if (isset($all['name']) && !empty($all['name'])) {

@ -157,8 +157,7 @@ class CourseSign extends SoftDeletesModel
public static function yhInvested($start_date = null, $end_date = null, $course_ids = null, $retList = false)
{
// 判断是否使用默认时间
$isDefaultDate = empty($start_date) || $start_date == CourseType::START_DATE || empty($course_ids);
$isDefaultDate = (empty($start_date) || $start_date == CourseType::START_DATE) && empty($course_ids);
// 获取学员ID列表
if ($isDefaultDate) {
// 默认时间:获取所有学员,不限制课程
@ -213,9 +212,14 @@ class CourseSign extends SoftDeletesModel
public static function genban($start_date, $end_date, $course_ids = null, $retList = false)
{
$courseSignsQuery = self::getStudentList($start_date, $end_date, 1, $course_ids);
// 获取制定的课程id
$genbanCourse = Course::whereHas('typeDetail', function ($query) {
$query->whereIn('id', [1, 3, 14]);
})->get();
$courseSigns = $courseSignsQuery->whereHas('user', function ($query) {
$query->where('from', 'like', '%跟班学员%');
})->get();
})->whereIn('course_id', $genbanCourse->pluck('id'))->get();
if ($retList) {
return User::with('company')->whereIn('id', $courseSigns->pluck('user_id'))->get();

Loading…
Cancel
Save