[Custom Map] Fixed error if logbook is empty
这个提交包含在:
父节点
8c7fa355fb
当前提交
8719441eb6
共有 2 个文件被更改,包括 42 次插入 和 31 次删除
|
|
@ -69,7 +69,12 @@ class Map extends CI_Controller {
|
|||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$result = $CI->logbooks_model->logbook($this->session->userdata('active_station_logbook'))->result();
|
||||
|
||||
if ($result) {
|
||||
$logbook_name = $result[0]->logbook_name;
|
||||
} else {
|
||||
$logbook_name = '';
|
||||
}
|
||||
|
||||
// load the view
|
||||
$data['logbook_name'] = $logbook_name;
|
||||
|
|
@ -111,6 +116,7 @@ class Map extends CI_Controller {
|
|||
|
||||
echo "{\"markers\": [";
|
||||
$count = 1;
|
||||
if ($qsos) {
|
||||
foreach ($qsos->result() as $row) {
|
||||
//print_r($row);
|
||||
if($row->COL_GRIDSQUARE != null) {
|
||||
|
|
@ -144,6 +150,7 @@ class Map extends CI_Controller {
|
|||
$count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
echo "]";
|
||||
|
|
|
|||
|
|
@ -1074,6 +1074,10 @@ class Logbook_model extends CI_Model {
|
|||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$this->db->where("COL_TIME_ON BETWEEN '".$start."' AND '".$end."'");
|
||||
$this->db->where_in("station_id", $logbooks_locations_array);
|
||||
|
||||
|
|
|
|||
正在加载…
在新工单中引用