db->createCommand($sql)->execute(); if(!empty($res)) return ''; $sql=" CREATE TABLE `qimall_video_tutorials_log` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `admin_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '账户id', `video_tutorials_id` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '视频教程id', `is_complete` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否完整观看;1:是;0否', `view_times` int(11) NOT NULL DEFAULT '0' COMMENT '浏览时长', `created_at` int(11) NOT NULL DEFAULT '0', `updated_at` int(11) NOT NULL DEFAULT '0', `status` tinyint(1) DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='视频教程浏览记录'; "; $this->execute($sql); }catch (\Exception $e){ } } /** * {@inheritdoc} */ public function safeDown() { echo "M230621080751QimallVideoTutorialsLog cannot be reverted.\n"; return false; } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "M230621080751QimallVideoTutorialsLog cannot be reverted.\n"; return false; } */ }