Commit a8cab3fb authored by Antonio.Suerte's avatar Antonio.Suerte

List Optimization: Operation Logs and History

parent eb513459
...@@ -454,8 +454,10 @@ class DevTools extends DevComponents { ...@@ -454,8 +454,10 @@ class DevTools extends DevComponents {
if(isset($action[VAL_INT_1])){ if(isset($action[VAL_INT_1])){
if(in_array($action[VAL_INT_1], $containerContent -> ip_address)){ if(in_array($action[VAL_INT_1], $containerContent -> ip_address)){
foreach($containerContent -> ip_address as $key => $ipAddr){ foreach($containerContent -> ip_address as $key => $ipAddr){
if($ipAddr == $action[VAL_INT_1]) if($ipAddr == $action[VAL_INT_1]){
unset($containerContent -> ip_address[$key]); unset($containerContent -> ip_address[$key]);
$containerContent -> ip_address = array_values($containerContent -> ip_address);
}
} }
$toUpdateDebugContainer = true; $toUpdateDebugContainer = true;
}else }else
...@@ -490,8 +492,10 @@ class DevTools extends DevComponents { ...@@ -490,8 +492,10 @@ class DevTools extends DevComponents {
if(in_array($action[VAL_INT_1], $queryMap)){ if(in_array($action[VAL_INT_1], $queryMap)){
foreach($containerContent -> my_commands as $key => $nested){ foreach($containerContent -> my_commands as $key => $nested){
if($nested -> query_name == $action[VAL_INT_1]) if($nested -> query_name == $action[VAL_INT_1]){
unset($containerContent -> my_commands[$key]); unset($containerContent -> my_commands[$key]);
$containerContent -> my_commands = array_values($containerContent -> my_commands);
}
} }
$toUpdateDebugContainer = true; $toUpdateDebugContainer = true;
}else }else
......
...@@ -288,26 +288,19 @@ class AdminLogModelClass extends ModelClassEx { ...@@ -288,26 +288,19 @@ class AdminLogModelClass extends ModelClassEx {
} }
//search via status //search via status
// if($this -> getType() == NO_STRING) { // 検索ボタンを押している場合 if(is_array($this -> category)) {
$where .= ' AND (';
if(is_array($this -> category)) { foreach($this -> category as $row)
$category[] = 'login_history.transaction_type = (\')' . $row . '(\')';
$where .= ' AND (';
$where .= implode(DELIMIT_OR, $category) . ')';
foreach($this -> category as $row) { }else
$category[] = 'login_history.transaction_type = (\')' . $row . '(\')'; $where .= 'AND login_history.transaction_type != (\')'. NO_COUNT .'(\')';
}
$where .= implode(DELIMIT_OR, $category) . ')';
}else{
$where .= 'AND login_history.transaction_type != (\')'. NO_COUNT .'(\')';
}
// }
if($this -> sDate != NO_STRING){ if($this -> sDate != NO_STRING){
//search via date (FROM) //search via date (FROM)
if($this -> sFrom != '2014/01/01' if($this -> sFrom != NO_STRING) {
&& $this -> sFrom != NO_STRING) {
$where .= ' AND login_history.create_time >= (\')' . str_replace(DELIMIT_SLASH, DELIMIT_HYPHEN, $this -> sFrom) . '(\')'; $where .= ' AND login_history.create_time >= (\')' . str_replace(DELIMIT_SLASH, DELIMIT_HYPHEN, $this -> sFrom) . '(\')';
} }
...@@ -316,17 +309,15 @@ class AdminLogModelClass extends ModelClassEx { ...@@ -316,17 +309,15 @@ class AdminLogModelClass extends ModelClassEx {
$where .= ' AND login_history.create_time < DATE_ADD((\')' . str_replace(DELIMIT_SLASH, DELIMIT_HYPHEN, $this -> sTo) . '(\'), INTERVAL 1 DAY)'; $where .= ' AND login_history.create_time < DATE_ADD((\')' . str_replace(DELIMIT_SLASH, DELIMIT_HYPHEN, $this -> sTo) . '(\'), INTERVAL 1 DAY)';
} }
}else{ }else{
$where .= ' AND login_history.create_time >= (\')' . '2014/01/01' . '(\')'; $where .= ' AND login_history.create_time >= (\')' . date('Y-m-01') . '(\')';
$where .= ' AND login_history.create_time < DATE_ADD((\')' . date('Y-m-d') . '(\'), INTERVAL 1 DAY)'; $where .= ' AND login_history.create_time < DATE_ADD((\')' . date('Y-m-d') . '(\'), INTERVAL 1 DAY)';
} }
// ページ数 // ページ数
$start = ($this -> getTargetPage() - VAL_INT_1) * VAR_DEFAULT_PAGE_COUNT; $start = ($this -> getTargetPage() - VAL_INT_1) * VAR_DEFAULT_PAGE_COUNT;
$end = $this -> getTargetPage() * VAR_DEFAULT_PAGE_COUNT;
$page = ' LIMIT ' . $start . DELIMIT_COMMA . VAL_INT_50; $page = ' LIMIT ' . $start . DELIMIT_COMMA . VAL_INT_50;
$rtn[] = $where; $rtn[] = $where;
$rtn[] = $page; $rtn[] = $page;
......
...@@ -123,29 +123,32 @@ class LoginHistoryModelClass extends ModelClassEx { ...@@ -123,29 +123,32 @@ class LoginHistoryModelClass extends ModelClassEx {
} }
if($this -> loginFlg != NO_STRING){ if($this -> loginFlg != NO_STRING){
// 登録時刻(開始日)(検索項目) // 登録時刻(開始日)(検索項目)
if($this -> sFrom != NO_STRING) { if($this -> sFrom != NO_STRING)
$rtn[] = ' login_history.create_time >= (\')' . $this -> sFrom . '(\')'; $rtn[] = ' login_history.create_time >= (\')' . $this -> sFrom . '(\')';
}
// 登録時刻(終了)(検索項目) // 登録時刻(終了)(検索項目)
if($this -> sTo != NO_STRING) { if($this -> sTo != NO_STRING)
$rtn[] = ' login_history.create_time < DATE_ADD((\')' . $this -> sTo . '(\'), INTERVAL 1 DAY)'; $rtn[] = ' login_history.create_time < DATE_ADD((\')' . $this -> sTo . '(\'), INTERVAL 1 DAY)';
}
}else{
$firstDayOfTheMonth = date("Y-m-01");
$crrntDayOfTheMonth = date("Y-m-d");
$rtn[] = " login_history.create_time >= ('){$firstDayOfTheMonth}(') AND login_history.create_time <= DATE_ADD(('){$crrntDayOfTheMonth}('), INTERVAL 1 DAY)";
} }
// ページ数 // ページ数
$start = ($this -> getTargetPage() - VAL_INT_1) * VAR_DEFAULT_PAGE_COUNT; $start = ($this -> getTargetPage() - VAL_INT_1) * VAR_DEFAULT_PAGE_COUNT;
$end = $this -> getTargetPage() * VAR_DEFAULT_PAGE_COUNT;
$page = ' LIMIT ' . $start . DELIMIT_COMMA . VAL_INT_50; $page = ' LIMIT ' . $start . DELIMIT_COMMA . VAL_INT_50;
// 検索条件の結合 // 検索条件の結合
if(count($rtn) > NO_COUNT) { if(count($rtn) > NO_COUNT)
return array(DELIMIT_AND . implode(DELIMIT_AND, $rtn), $page); return array(DELIMIT_AND . implode(DELIMIT_AND, $rtn), $page);
} else {
return array(NO_STRING, $page); return array(NO_STRING, $page);
}
} }
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment