Commit 69b6cd64 authored by zw's avatar zw

log

parent 101c43a4
...@@ -12,6 +12,17 @@ use think\console\command\make\Model; ...@@ -12,6 +12,17 @@ use think\console\command\make\Model;
class KillOutTimeSql{ class KillOutTimeSql{
public function killOutTimeSql(){ public function killOutTimeSql(){
$checkDayStr = date('Y-m-d ', time());
$timeBegin1 = strtotime($checkDayStr . "18:30:00");
$timeEnd1 = strtotime($checkDayStr . "20:00:00");
$curr_time = time();
if ($curr_time < $timeBegin1 || $curr_time > $timeEnd1) {
return;
}
$model = new ASite(); $model = new ASite();
$sql = "select concat('KILL ',id) as kill_sql,info from information_schema.processlist where user='tl_root' and time > 20 and db='db_tongliandichan' or db is null"; $sql = "select concat('KILL ',id) as kill_sql,info from information_schema.processlist where user='tl_root' and time > 20 and db='db_tongliandichan' or db is null";
//$sql = "select concat('KILL ',id,';') as kill_sql,info from information_schema.processlist where user='tldc_online' and time > 20 and db='db_tongliandichan' or db is null"; //$sql = "select concat('KILL ',id,';') as kill_sql,info from information_schema.processlist where user='tldc_online' and time > 20 and db='db_tongliandichan' or db is null";
...@@ -26,5 +37,7 @@ class KillOutTimeSql{ ...@@ -26,5 +37,7 @@ class KillOutTimeSql{
} }
} }
echo "success!";
return;
} }
} }
\ No newline at end of file
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