优化查询sql

mobile-first
cyc 5 years ago
parent 6a6f99d3e8
commit 76c6148a4b

@ -702,7 +702,11 @@ class Information extends CI_Controller
function backup_content($log_id)
{
$data['log_info'] = $this->Logs_model->read($log_id);
$data['log_list'] = $this->Logs_model->get_all_backup_list($data['log_info']->log_res_id);
if($data['log_info']->log_action == 'backup_amp'){
$data['log_list'] = $this->Logs_model->get_all_backup_list($data['log_info']->log_res_id,true);
}else{
$data['log_list'] = $this->Logs_model->get_all_backup_list($data['log_info']->log_res_id);
}
$this->load->view('bootstrap/header', $data);
$this->load->view('bootstrap/information_backup_content');
$this->load->view('bootstrap/footer');

@ -51,10 +51,15 @@ class Logs_model extends CI_Model {
}
//获取所有备份信息内容
function get_all_backup_list($is_id) {
function get_all_backup_list($is_id,$amp=false) {
$this->init();
$this->log_res_id = " AND il.log_res_id =" . $this->HT->escape($is_id);
$this->log_action = " AND (il.log_action = 'backup_info' or il.log_action = 'backup_amp')";
if($amp){
$this->log_action = " AND (il.log_action = 'backup_amp')";
}else{
$this->log_action = " AND (il.log_action = 'backup_info')";
}
return $this->get_list();
}

Loading…
Cancel
Save