db->createCommand($check_table_sql)->execute(); if(!empty($res)) return ''; // 插入表数据 $sql="INSERT INTO `qimall_global_var_map`( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ( 'extra_equal_1', '平一级奖励', 'CapitalTypeMap', 0, 1, 1661841988, 1661841988);"; $this->execute($sql); $sql="INSERT INTO `qimall_global_var_map`( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ( 'extra_equal_2', '平二级奖励', 'CapitalTypeMap', 0, 1, 1661841988, 1661841988);"; $this->execute($sql); $sql="INSERT INTO `qimall_global_var_map`( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ('drainage_subsidy', '引流补贴', 'CapitalTypeMap', 0, 1, 1661841988, 1661841988)"; $this->execute($sql); $sql="INSERT INTO `qimall_global_var_map`( `name`, `title`, `type`, `is_addons`, `status`, `created_at`, `updated_at`) VALUES ( 'team_subsidy', '团队补贴', 'CapitalTypeMap', 0, 1, 1661841988, 1661841988);"; $this->execute($sql); }catch (\Exception $e){ } } /** * {@inheritdoc} */ public function safeDown() { echo "M220909073847CreateQimallGlobalVarMap cannot be reverted.\n"; return false; } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "M220909073847CreateQimallGlobalVarMap cannot be reverted.\n"; return false; } */ }