db->createCommand($sql)->execute(); if(!empty($res)) return ''; $this->execute("CREATE TABLE `qimall_addons_store_goods_tracking` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mall_id` int(11) NOT NULL DEFAULT '0' COMMENT '商城ID', `store_id` int(11) NOT NULL DEFAULT '0' COMMENT '门店id', `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品id', `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户id', `browse_num` int(11) NOT NULL DEFAULT '0' COMMENT '浏览次数', `track_date` int(11) NOT NULL DEFAULT '0' COMMENT '日期,格式ymd[20240826]', `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[0禁用 1启用 -1删除]', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`id`), KEY `mall_id` (`mall_id`) USING BTREE, KEY `store_id` (`store_id`) USING BTREE, KEY `goods_id` (`goods_id`) USING BTREE, KEY `user_id` (`user_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='商城商品埋点表';"); } /** * {@inheritdoc} */ public function safeDown() { echo "M240826203048CreateQimallAddonsStoretrack cannot be reverted.\n"; return false; } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "M240716083948AlterQimallAddonsStoreAdmin cannot be reverted.\n"; return false; } */ }