Populate COL_DISTANCE at DB when plotting

这个提交包含在:
int2001 2023-08-27 05:37:16 +00:00
父节点 67bad9fcbb
当前提交 2f694e060e
找不到此签名对应的密钥
GPG 密钥 ID: DFB1C13CD2DB037B

查看文件

@ -25,7 +25,7 @@ class Distances_model extends CI_Model
if ($station_gridsquare != null) {
$gridsquare = explode(',', $station_gridsquare); // We need to convert to an array, since a user can enter several gridsquares
$this->db->select('col_call callsign, col_gridsquare grid');
$this->db->select('COL_PRIMARY_KEY,COL_DISTANCE,col_call callsign, col_gridsquare grid');
$this->db->where('LENGTH(col_gridsquare) >', 0);
if ($postdata['band'] == 'sat') {
@ -148,8 +148,7 @@ class Distances_model extends CI_Model
header('Content-Type: application/json');
echo json_encode(array('Error' => 'Error. There is a problem with the gridsquare set in your profile!'));
exit;
}
else {
} else {
// Making the array we will use for plotting, we save occurrences of the length of each qso in the array
$j = 0;
for ($i = 0; $j < $dist; $i++) {
@ -171,6 +170,9 @@ class Distances_model extends CI_Model
foreach ($qsoArray as $qso) {
$qrb['Qsos']++; // Counts up number of qsos
$bearingdistance = $this->bearing_dist($stationgrid, $qso['grid'], $measurement_base); // Calculates distance based on grids
if (($qso['COL_DISTANCE'] ?? -1) != $bearingdistance) {
log_message("error",$qso['COL_PRIMARY_KEY'].' from '.$qso['COL_DISTANCE'].' to '.$bearingdistance);
}
$arrayplacement = (int)($bearingdistance / 50); // Resolution is 50, calculates where to put result in array
if ($bearingdistance > $qrb['Distance']) { // Saves the longest QSO
$qrb['Distance'] = $bearingdistance;