setTableById($year_month); } } public function setTableById($channel) { if (! empty($channel)) { $tb = $this->table.'_' . (string)$channel; $this->createTable($tb); $this->setTable($tb); } } //创建表 private function createTable($table){ if(! empty($table) && ! Schema::hasTable($table)){ //执行建表语句 DB::statement('create table '. $table .' like device_data_for_create'); } } public function is_table_isset(){ if(Schema::hasTable($this->table)) return true; return false; } }