execute($sql); $sql = "INSERT INTO `qimall_addons_store_menu` (`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`, `addons_name`, `is_addon`) VALUES ('108', '核销券', '0', '0', 'store/verification/index/index', '', '2', '0', '999', NULL, '', '1', '0', '0', 'Verification', '1'); INSERT INTO `qimall_addons_store_menu` (`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`, `addons_name`, `is_addon`) VALUES ('109', '核销券', '0', '108', 'store/verification/index/index', '', '2', '0', '999', NULL, '', '1', '0', '0', 'Verification', '1'); INSERT INTO `qimall_addons_store_menu` (`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`, `addons_name`, `is_addon`) VALUES ('110', '会员核销券', '0', '108', 'store/verification/index/user', '', '2', '0', '999', NULL, '', '1', '0', '0', 'Verification', '1'); INSERT INTO `qimall_addons_store_menu` (`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`, `addons_name`, `is_addon`) VALUES ('111', '使用记录', '0', '108', 'store/verification/index/log', '', '2', '0', '999', NULL, '', '1', '0', '0', 'Verification', '1'); INSERT INTO `qimall_addons_store_menu` (`id`, `title`, `app_id`, `pid`, `url`, `icon`, `level`, `dev`, `sort`, `params`, `tree`, `status`, `created_at`, `updated_at`, `addons_name`, `is_addon`) VALUES ('112', '基础设置', '0', '108', 'store/verification/index/setting', '', '2', '0', '999', NULL, '', '1', '0', '0', 'Verification', '1');"; $this->execute($sql); $sql = "CREATE TABLE `qimall_addons_store_verification_coupons` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mall_id` int(10) NOT NULL DEFAULT '0' COMMENT '商城ID', `store_id` int(10) NOT NULL DEFAULT '0' COMMENT '门店ID', `name` varchar(100) NOT NULL DEFAULT '' COMMENT '核销券名称', `num` int(10) NOT NULL DEFAULT '0' COMMENT '发行数量', `start_at` int(10) NOT NULL DEFAULT '0' COMMENT '使用时间', `end_at` int(10) NOT NULL DEFAULT '0' COMMENT '使用时间', `style_pic_url` varchar(255) NOT NULL DEFAULT '' COMMENT '核销券海报', `sort` int(10) NOT NULL DEFAULT '0' COMMENT '排序', `issued_num` int(10) NOT NULL DEFAULT '0' COMMENT '已发放数量', `used_num` int(10) NOT NULL DEFAULT '0' COMMENT '已核销数量', `status` tinyint(4) DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]', `created_at` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间', `updated_at` int(10) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;"; $this->execute($sql); $sql = "CREATE TABLE `qimall_addons_store_verification_coupons_user` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mall_id` int(10) NOT NULL DEFAULT '0' COMMENT '商城ID', `store_id` int(10) NOT NULL DEFAULT '0' COMMENT '门店ID', `user_id` int(10) NOT NULL DEFAULT '0' COMMENT '用户ID', `coupon_id` int(10) NOT NULL DEFAULT '0' COMMENT '核销券ID', `num` int(10) NOT NULL DEFAULT '0' COMMENT '发行数量', `used_num` int(10) NOT NULL DEFAULT '0' COMMENT '已核销数量', `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]', `created_at` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间', `updated_at` int(10) NOT NULL DEFAULT '0' COMMENT '修改时间', `is_transfer` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否他人转赠', `from_user_id` int(10) NOT NULL DEFAULT '0' COMMENT '来源用户ID', `from_coupon_user_id` int(10) NOT NULL DEFAULT '0' COMMENT '来源券ID', PRIMARY KEY (`id`), KEY `store_id` (`store_id`) USING BTREE, KEY `user_id` (`user_id`) USING BTREE, KEY `coupon_id` (`coupon_id`) USING BTREE, KEY `from_coupon_user_id` (`from_coupon_user_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;"; $this->execute($sql); $sql = "CREATE TABLE `qimall_addons_store_verification_setting` ( `id` int(11) NOT NULL AUTO_INCREMENT, `mall_id` int(11) NOT NULL, `store_id` int(11) NOT NULL DEFAULT '0', `key` varchar(255) NOT NULL, `value` longtext NOT NULL, `status` tinyint(4) DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]', `created_at` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', PRIMARY KEY (`id`) USING BTREE, KEY `mall_id` (`mall_id`) USING BTREE, KEY `key` (`key`(191)) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT;"; $this->execute($sql); $sql = "CREATE TABLE `qimall_store_verification_coupons_clerk_log` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `mall_id` int(11) NOT NULL DEFAULT '0', `store_id` int(11) NOT NULL DEFAULT '0' COMMENT '门店id', `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '会员id', `clerk_id` int(11) NOT NULL DEFAULT '0' COMMENT '核销员id', `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 '修改时间', `coupon_id` int(10) NOT NULL DEFAULT '0' COMMENT '核销券ID', `from_coupon_user_id` int(10) NOT NULL DEFAULT '0' COMMENT '来源券ID', PRIMARY KEY (`id`) USING BTREE, KEY `store_id` (`store_id`) USING BTREE, KEY `user_id` (`user_id`) USING BTREE, KEY `coupon_id` (`coupon_id`) USING BTREE, KEY `from_coupon_user_id` (`from_coupon_user_id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='门店核销券明细';"; $this->execute($sql); } /** * {@inheritdoc} */ public function safeDown() { echo "M240112103353StoreVerification cannot be reverted.\n"; return false; } /* // Use up()/down() to run migration code without a transaction. public function up() { } public function down() { echo "M240112103353StoreVerification cannot be reverted.\n"; return false; } */ }