db->createCommand($sql)->execute(); if (!empty($res)) return ''; $sql = " CREATE TABLE `qimall_addons_distribution_upgrade_limit` ( `id` int(10) NOT NULL AUTO_INCREMENT, `mall_id` int(10) DEFAULT '0' COMMENT '商城ID', `user_id` int(10) DEFAULT '0' COMMENT '消费者ID', `serve_uid` int(4) DEFAULT '0' COMMENT '消费者上级ID', `level` tinyint(4) DEFAULT '0' COMMENT '消费者上级等级', `achievement` decimal(12,2) DEFAULT '0.00' COMMENT '为上级贡献的业绩,单位:元', `status` tinyint(4) DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]', `created_at` int(10) DEFAULT '0' COMMENT '创建时间', `updated_at` int(10) DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`id`) USING BTREE, KEY `user_id+serve_uid` (`user_id`,`serve_uid`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='分销商商团队业绩升级限制表'; "; $this->execute($sql); } catch (\Exception $e) { } } /** * {@inheritdoc} */ public function safeDown() { echo "M230406095550QimallAddonsDistributionUpgradeLimit cannot be reverted.\n"; return false; } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "M230406095550QimallAddonsDistributionUpgradeLimit cannot be reverted.\n"; return false; } */ }