[Tweak] Query speedup on dashboard
这个提交包含在:
		
							父节点
							
								
									5ca3ea2d7e
								
							
						
					
					
						当前提交
						3a0ab51d84
					
				
					共有  1 个文件被更改,包括 11 次插入 和 6 次删除
				
			
		|  | @ -1175,12 +1175,17 @@ class Logbook_model extends CI_Model { | ||||||
|     } |     } | ||||||
|    |    | ||||||
|     if ($logbooks_locations_array) { |     if ($logbooks_locations_array) { | ||||||
|       $this->db->where_in($this->config->item('table_name').'.station_id', $logbooks_locations_array); |       $location_list = "'".implode("','",$logbooks_locations_array)."'"; | ||||||
|       $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); |        | ||||||
|       $this->db->join('dxcc_entities', $this->config->item('table_name').'.col_dxcc = dxcc_entities.adif', 'left'); |       $sql = "SELECT * FROM ( select * from " . $this->config->item('table_name'). " | ||||||
|       $this->db->order_by("COL_TIME_ON", "desc"); |         WHERE station_id IN(". $location_list .") | ||||||
|       $this->db->limit($num); |         order by col_time_on desc | ||||||
|       $query = $this->db->get($this->config->item('table_name')); |         limit " . $num .
 | ||||||
|  |         ") hrd
 | ||||||
|  |         JOIN station_profile ON station_profile.station_id = hrd.station_id | ||||||
|  |         LEFT JOIN dxcc_entities ON hrd.col_dxcc = dxcc_entities.adif";
 | ||||||
|  | 
 | ||||||
|  |       $query = $this->db->query($sql); | ||||||
|      |      | ||||||
|       return $query; |       return $query; | ||||||
|     } else { |     } else { | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用