|
|
|
|
@ -528,6 +528,13 @@ class CourseController extends CommonController
|
|
|
|
|
if (date('Y-m-d') != $courseContent->date) {
|
|
|
|
|
return $this->fail([ResponseCode::ERROR_BUSINESS, '不在签到时间']);
|
|
|
|
|
}
|
|
|
|
|
// 不能重复签到
|
|
|
|
|
$courseContentCheck = CourseContentCheck::where('course_content_id', $all['course_content_id'])
|
|
|
|
|
->where('user_id', $this->getUserId())
|
|
|
|
|
->first();
|
|
|
|
|
if ($courseContentCheck) {
|
|
|
|
|
return $this->fail([ResponseCode::ERROR_BUSINESS, '不能重复签到']);
|
|
|
|
|
}
|
|
|
|
|
CourseContentCheck::create([
|
|
|
|
|
'course_content_id' => $all['course_content_id'],
|
|
|
|
|
'user_id' => $this->getUserId(),
|
|
|
|
|
|