@@ -1728,6 +1728,43 @@ public function run($args)
17281728 Yii::app ()->db ->createCommand ($ sql )->execute ();
17291729 }
17301730
1731+ //2022-05-25
1732+ if ($ version == '7.8.1.4 ' ) {
1733+
1734+ $ sql = "SELECT priority FROM pkg_module WHERE id_module = 1 ORDER BY priority DESC " ;
1735+ $ result = Yii::app ()->db ->createCommand ($ sql )->queryAll ();
1736+ if (isset ($ result [0 ]['priority ' ])) {
1737+ $ sql = "INSERT INTO pkg_module VALUES (NULL, 't(''User History'')', 'userhistory', 'x-fa fa-desktop', 1, " . ($ result [0 ]['priority ' ] + 1 ) . ") " ;
1738+ $ this ->executeDB ($ sql );
1739+ $ idServiceModule = Yii::app ()->db ->lastInsertID ;
1740+
1741+ $ sql = "INSERT INTO pkg_group_module VALUES ((SELECT id FROM pkg_group_user WHERE id_user_type = 1 LIMIT 1), ' " . $ idServiceModule . "', 'crud', '1', '1', '1'); " ;
1742+ $ this ->executeDB ($ sql );
1743+ }
1744+
1745+ $ version = '7.8.1.5 ' ;
1746+ $ sql = "UPDATE pkg_configuration SET config_value = ' " . $ version . "' WHERE config_key = 'version' " ;
1747+ Yii::app ()->db ->createCommand ($ sql )->execute ();
1748+ }
1749+
1750+ //2022-05-25
1751+ if ($ version == '7.8.1.5 ' ) {
1752+ $ sql = "CREATE TABLE `pkg_user_history` (
1753+ `id` int(11) NOT NULL AUTO_INCREMENT,
1754+ `id_user` int(11) NOT NULL,
1755+ `description` mediumtext,
1756+ `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
1757+ PRIMARY KEY (`id`),
1758+ KEY `fk_pkg_user_pkg_user_history` (`id_user`),
1759+ CONSTRAINT `fk_pkg_user_pkg_user_history` FOREIGN KEY (`id_user`) REFERENCES `pkg_user` (`id`) ON DELETE CASCADE
1760+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1761+ " ;
1762+ $ this ->executeDB ($ sql );
1763+
1764+ $ version = '7.8.1.6 ' ;
1765+ $ sql = "UPDATE pkg_configuration SET config_value = ' " . $ version . "' WHERE config_key = 'version' " ;
1766+ Yii::app ()->db ->createCommand ($ sql )->execute ();
1767+ }
17311768 }
17321769
17331770 public function executeDB ($ sql )
0 commit comments