Commit d1797199 authored by 吴贤德's avatar 吴贤德

播放日志分表

parent 1520bfd5
......@@ -297,9 +297,31 @@ class CenterAction extends Action
public function tb_playlog_create(){
//参数
$curMonth = date("Ym");
$nextMonth = date("Ym",strtotime("+1 month"));
//创建表
$srcTable = "sh_log_play";
$curMonthTable = $srcTable."_".$curMonth;
$nextMonthTable = $srcTable."_".$nextMonth;
$this->createTable($srcTable,$curMonthTable);
$this->createTable($srcTable,$nextMonthTable);
}
//------ 表创建方法 ------
function createTable($srcTable,$targetTable){
echo $srcTable."->".$targetTable;
$qsql="SELECT table_name FROM information_schema.TABLES WHERE table_name = '$targetTable';";
$arrTables = D("")->query($qsql);
if (count ($arrTables)<=0){
$csql = "CREATE TABLE $targetTable LIKE $srcTable;";
D("")->execute($csql);
}
}
function HttpPost($url,$param){
$ch = curl_init();
......
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