mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Merge pull request #2917 from int2001/fix_map_pagination
This commit is contained in:
@@ -2185,9 +2185,6 @@ class Logbook_model extends CI_Model {
|
||||
$binding[] = $band;
|
||||
}
|
||||
}
|
||||
if ($map == true) {
|
||||
$sql .= " AND ( qsos.`col_gridsquare` != '' OR qsos.`col_vucc_grids` != '')";
|
||||
}
|
||||
$sql .= " AND qsos.`station_id` IN ?
|
||||
ORDER BY qsos.`COL_TIME_ON` DESC, qsos.`COL_PRIMARY_KEY` DESC";
|
||||
$binding[] = $logbooks_locations_array;
|
||||
@@ -2213,6 +2210,16 @@ class Logbook_model extends CI_Model {
|
||||
}
|
||||
unset($row);
|
||||
|
||||
// Apply map filter in PHP to ensure pagination works correctly
|
||||
// When $map is true, filter out QSOs without gridsquare data AFTER applying LIMIT/OFFSET
|
||||
if ($map == true) {
|
||||
$results = array_filter($results, function($row) {
|
||||
return !empty($row->COL_GRIDSQUARE) || !empty($row->COL_VUCC_GRIDS);
|
||||
});
|
||||
// Re-index array after filtering
|
||||
$results = array_values($results);
|
||||
}
|
||||
|
||||
// Return a query-like object with result() method for compatibility
|
||||
return new class($results) {
|
||||
private $data;
|
||||
|
||||
Reference in New Issue
Block a user