|
|
|
|
@ -484,10 +484,7 @@ class CourseController extends CommonController
|
|
|
|
|
$content_check_range = Config::getValueByKey('content_check_range');
|
|
|
|
|
$courseContent = CourseContent::find($all['course_content_id']);
|
|
|
|
|
$distance = getDistance($courseContent->longitude, $courseContent->latitude, $all['longitude'], $all['latitude']);
|
|
|
|
|
if ($distance > $content_check_range) {
|
|
|
|
|
return $this->fail([ResponseCode::ERROR_BUSINESS, '超出打卡范围']);
|
|
|
|
|
}
|
|
|
|
|
return $this->success('成功');
|
|
|
|
|
return $this->success(compact('distance', 'content_check_range'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -564,13 +561,12 @@ class CourseController extends CommonController
|
|
|
|
|
if ($validator->fails()) {
|
|
|
|
|
return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]);
|
|
|
|
|
}
|
|
|
|
|
// 获取打卡范围,千米
|
|
|
|
|
$content_check_range = Config::getValueByKey('content_check_range');
|
|
|
|
|
|
|
|
|
|
$list = CourseContentCheck::where('course_content_id', $all['course_content_id'])
|
|
|
|
|
->where('user_id', $this->getUserId())
|
|
|
|
|
->orderBy('created_at', 'desc')
|
|
|
|
|
->get();
|
|
|
|
|
return $this->success(compact('list', 'content_check_range'));
|
|
|
|
|
return $this->success(compact('list'));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|