Это колесо фортуны -только полк замените на свое...
INSERT INTO `polk_controllers` (`title`, `name`, `is_enabled`, `author`, `url`, `version`, `is_backend`)
SELECT 'Колесо фортуны PRO', 'coolwheel', 1, 'Нифигассе о-го-гошеньки', 'https://instantcms.ru/users/asnenne', '', 1
FROM DUAL
WHERE NOT EXISTS(
SELECT 1
FROM `polk_controllers`
WHERE `name` = 'coolwheel'
)
LIMIT 1;
UPDATE`polk_controllers` SET `version` = '1.0.7' WHERE `name`= 'coolwheel';
INSERT INTO `polk_widgets` (`controller`, `name`, `title`, `author`, `url`, `version`)
SELECT 'coolwheel', 'coolwheel', 'Колесо фортуны PRO', 'Нифигассе о-го-гошеньки', 'https://instantcms.ru/users/asnenne', '1.0.0'
FROM DUAL
WHERE NOT EXISTS(
SELECT 1
FROM `polk_widgets`
WHERE `name` = 'coolwheel'
)
LIMIT 1;
INSERT INTO `polk_widgets` (`controller`, `name`, `title`, `author`, `url`, `version`)
SELECT 'coolwheel', 'wheelnotice', 'Всплывающие уведомления', 'Нифигассе о-го-гошеньки', 'https://instantcms.ru/users/asnenne', '1.0.0'
FROM DUAL
WHERE NOT EXISTS(
SELECT 1
FROM `polk_widgets`
WHERE `name` = 'wheelnotice'
)
LIMIT 1;
INSERT INTO `polk_scheduler_tasks` (`title`, `controller`, `hook`, `period`, `date_last_run`, `is_active`, `is_new`)
SELECT 'Колесо фортуны PRO: удаление лишних записей в таблицах', 'coolwheel', 'clear_tables', 60, '2021-04-20 00:00:00', 1, 0
FROM DUAL
WHERE NOT EXISTS(
SELECT 1
FROM `polk_scheduler_tasks`
WHERE `controller` = 'coolwheel'
)
LIMIT 1;
INSERT INTO `polk_users_tabs` (`title`, `controller`, `name`, `is_active`, `ordering`)
SELECT 'Колесо фортуны', 'coolwheel', 'coolwheel', 1, 100
FROM DUAL
WHERE NOT EXISTS(
SELECT 1
FROM `polk_users_tabs`
WHERE `name` = 'coolwheel'
)
LIMIT 1;
INSERT INTO `polk_activity_types` (`is_enabled`, `controller`, `name`, `title`, `description`)
SELECT 0, 'coolwheel', 'coolwheel', 'Выигрыши в «Колесо фортуны»', '%s'
FROM DUAL
WHERE NOT EXISTS(
SELECT 1
FROM `polk_activity_types`
WHERE `name` = 'coolwheel'
)
LIMIT 1;
CREATE TABLE IF NOT EXISTS `polk_coolwheel` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`wheel_id` int(11) DEFAULT NULL,
`segment_id` int(11) DEFAULT NULL,
`user_id` int(11) DEFAULT NULL,
`widget_id` int(11) DEFAULT NULL,
`prize` int(11) DEFAULT NULL,
`contact` varchar(100) DEFAULT NULL,
`date_spin` timestamp NULL DEFAULT NULL,
`compare` varchar(32) DEFAULT NULL,
`secret` varchar(32) DEFAULT NULL,
`token` varchar(100) DEFAULT NULL,
`count` int(100) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `polk_coolwheel_count` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`wheel_id` int(11) DEFAULT NULL,
`count` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `polk_coolwheel_log` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`widget_id` int(11) DEFAULT NULL,
`wheel_id` int(100) NOT NULL,
`segment_id` int(100) NOT NULL,
`prize` float DEFAULT NULL,
`prize_text` varchar(250) DEFAULT NULL,
`cur` varchar(11) DEFAULT NULL,
`date_spin` timestamp NULL DEFAULT NULL,
`status` int(1) NOT NULL DEFAULT '1',
`contact` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `polk_coolwheel_reg` (
`id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`date_del` int(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `polk_coolwheel_segments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`wheel_id` int(11) DEFAULT NULL,
`ordering` int(11) UNSIGNED DEFAULT '100500',
`type_prize` varchar(11) DEFAULT NULL,
`zero_value` varchar(100) DEFAULT NULL,
`prize` float NOT NULL DEFAULT '0',
`plan_id` int(11) DEFAULT NULL,
`plan_period` varchar(11) NOT NULL DEFAULT 'day',
`custom_prize` varchar(50) DEFAULT NULL,
`sound` varchar(100) DEFAULT 'default_wheel_sound',
`win_text` text,
`win_btn_text` varchar(32) DEFAULT NULL,
`color` varchar(7) DEFAULT NULL,
`show_text` int(1) NOT NULL DEFAULT '1',
`font_size` int(11) DEFAULT NULL,
`text_color` varchar(7) DEFAULT NULL,
`shadow_color` varchar(7) DEFAULT NULL,
`chance` int(11) NOT NULL DEFAULT '0',
`limiting` varchar(30) NOT NULL DEFAULT 'not',
`limiting_num` int(11) DEFAULT '0',
`is_enabled` int(1) NOT NULL DEFAULT '1',
`num` int(100) DEFAULT '0',
`next_num` int(100) DEFAULT '0',
`is_deleted` int(1) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `polk_coolwheel_wheels_list` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(140) NOT NULL,
`users_spins` varchar(10) NOT NULL DEFAULT 'reg',
`ordering` int(11) UNSIGNED DEFAULT '100500',
`diameter` int(11) NOT NULL DEFAULT '560',
`diameter_inner` int(11) NOT NULL DEFAULT '0',
`add_bg_image` int(1) DEFAULT NULL,
`bg_image` text,
`add_bg_wheel` int(1) DEFAULT NULL,
`bg_wheel` text,
`padding` float NOT NULL DEFAULT '0',
`pointer` text,
`pointer_width` int(11) NOT NULL DEFAULT '0',
`show_cur` int(1) DEFAULT NULL,
`rating_title` varchar(128) DEFAULT NULL,
`rating_activity` varchar(100) DEFAULT NULL,
`billing_activity` varchar(100) DEFAULT NULL,
`zero_value` varchar(100) DEFAULT NULL,
`segment_color` varchar(7) DEFAULT NULL,
`text_orient` varchar(20) DEFAULT 'curved',
`text_align` varchar(20) NOT NULL DEFAULT 'center',
`text_margin` int(11) DEFAULT NULL,
`font_size` int(11) DEFAULT NULL,
`font_weight` varchar(20) NOT NULL DEFAULT 'normal',
`text_color` varchar(7) DEFAULT NULL,
`font_family` varchar(20) NOT NULL DEFAULT 'Arial',
`line_width` int(11) NOT NULL DEFAULT '0',
`stroke_color` varchar(7) DEFAULT NULL,
`show_pins` int(1) DEFAULT NULL,
`pins_num` int(2) NOT NULL DEFAULT '0',
`pins_margin` int(3) NOT NULL DEFAULT '0',
`pins_diameter` int(3) NOT NULL DEFAULT '0',
`pins_color` varchar(7) DEFAULT NULL,
`pins_border` varchar(7) DEFAULT NULL,
`sounds_on` int(1) DEFAULT NULL,
`tick_on` varchar(20) NOT NULL DEFAULT 'not',
`tick_sound` varchar(100) DEFAULT NULL,
`win_sound` varchar(100) DEFAULT NULL,
`lose_sound` varchar(100) DEFAULT NULL,
`guests_view` varchar(100) NOT NULL DEFAULT 'show',
`for_guests` text,
`contact_type` varchar(100) NOT NULL DEFAULT 'email',
`phone_mask` varchar(100) DEFAULT NULL,
`admin_email` varchar(250) DEFAULT NULL,
`is_deleted` int(1) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
ALTER TABLE `polk_coolwheel` MODIFY `count` INT(100) DEFAULT '0';
ALTER TABLE `polk_coolwheel_segments` MODIFY `num` INT(100) DEFAULT '0';
ALTER TABLE `polk_coolwheel_segments` MODIFY `next_num` INT(100) DEFAULT '0';