This commit is contained in:
2025-08-15 16:46:16 +08:00
parent 75a86edca2
commit a1fef05822

View File

@@ -333,15 +333,19 @@ class Course extends Model
$endSort = count($courseDetailsSetVos) + 1;
}
}
Log::info('$freeWatch==' . $freeWatch);
if($get['courseId'] == '1877654905222135809') {
Log::info('$freeWatch==' . $freeWatch);
}
// 已购买剧集ID集合
$detailsId = [];
if (!$freeWatch) {
$det_db = Db::connect(DatabaseRoute::getConnection('course_user', ['user_id' => $user['user_id']]));
Log::info('已购买剧集ID集合111==' . DatabaseRoute::getConnection('course_user', ['user_id' => $user['user_id']]));
$detailsId = $det_db->name('course_user')->where(['course_id' => $courseId, 'classify' => 2])->column('course_details_id');
$detailsId = array_flip(array_flip($detailsId)); // 去重
Log::info('已购买剧集ID集合222==' . json_encode($detailsId));
if($get['courseId'] == '1877654905222135809') {
Log::info('已购买剧集ID集合111==' . DatabaseRoute::getConnection('course_user', ['user_id' => $user['user_id']]));
Log::info('已购买剧集ID集合222==' . json_encode($detailsId));
}
}
// 处理剧集列表
$current = null;
@@ -352,10 +356,13 @@ class Course extends Model
$s['current'] = 1;
$current = &$s;
}
Log::info('$s[sort]==' . $s['sort']);
Log::info('$courseUser==' . $courseUser);
Log::info('$isVip==' . $isVip);
Log::info('$s[courseDetailsId]==' . !in_array($s['courseDetailsId'], $detailsId));
if($get['courseId'] == '1877654905222135809' && $s['sort'] == 18) {
Log::info('$s[sort]==' . $s['sort']);
Log::info('$courseUser==' . $courseUser);
Log::info('$isVip==' . $isVip);
Log::info('$s[courseDetailsId]==' . !in_array($s['courseDetailsId'], $detailsId));
}
// 非免费用户的权限控制
if (
!$freeWatch &&