✏️ 正在编辑: upgrade-15.05.04.php
路径:
/home/bpioifn/www/pigmentse/modules/opartdevis/upgrade/upgrade-15.05.04.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php /** * Prestashop module : OpartDevis * * @author Olivier CLEMENCE <manit4c@gmail.com> * @copyright Op'art * @license Tous droits réservés / Le droit d'auteur s'applique (All rights reserved / French copyright law applies) */ if (!defined('_PS_VERSION_')) { exit; } function upgrade_module_15_05_04($module) { $show_name = Db::getInstance()->ExecuteS( 'SHOW COLUMNS FROM `'._DB_PREFIX_.'opartdevis` LIKE \'name\'' ); if ($show_name == false) { Db::getInstance()->Execute( 'ALTER TABLE `'._DB_PREFIX_.$module->name.'` ADD `name` varchar(128) AFTER `id_customer`' ); } $message_visible = Db::getInstance()->ExecuteS( 'SHOW COLUMNS FROM `'._DB_PREFIX_.'opartdevis` LIKE \'message_visible\'' ); if ($message_visible == false) { Db::getInstance()->Execute( 'ALTER TABLE `'._DB_PREFIX_.$module->name.'` ADD `message_visible` TEXT AFTER `name`' ); } $id_customer_thread = Db::getInstance()->ExecuteS( 'SHOW COLUMNS FROM `'._DB_PREFIX_.'opartdevis` LIKE \'id_customer_thread\'' ); if ($id_customer_thread == false) { Db::getInstance()->Execute( 'ALTER TABLE `'._DB_PREFIX_.$module->name.'` ADD `id_customer_thread` int(10) AFTER `message_visible`' ); } $sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'opartdevis_text` ( `id_opartdevis_text` int(10) NOT NULL AUTO_INCREMENT, `text_value` TEXT NOT NULL, `text_type` int(10) NOT NULL, `id_lang` int(10) NOT NULL, PRIMARY KEY (`id_opartdevis_text`) ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'; Db::getInstance()->Execute($sql); return $module; }
💾 保存文件
← 返回文件管理器