✏️ 正在编辑: install-1.0.16.php
路径:
/home/bpioifn/www/pigmentse/modules/axepta/upgrade/install-1.0.16.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php /** * 1961-2020 BNP Paribas * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) that is available * through the world-wide-web at this URL: http://www.opensource.org/licenses/OSL-3.0 * If you are unable to obtain it through the world-wide-web, please send an email * to modules@quadra-informatique.fr so we can send you a copy immediately. * * @author Quadra Informatique <modules@quadra-informatique.fr> * @copyright 1961-2020 BNP Paribas * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ if (!defined('_PS_VERSION_')) { exit; } require_once _PS_MODULE_DIR_ . 'axepta/classes/AxeptaLogger.php'; function upgrade_module_1_0_16($module) { AxeptaLogger::log('Start', AxeptaLogger::LOG_DEBUG , AxeptaLogger::FILE_DEBUG); $data = [ [ 'query' => ['table' => 'axepta_customer_oneclick_payment_card', 'column' => 'holder_name'], 'sql' => 'axepta_customer_oneclick_payment_card` ADD `holder_name` VARCHAR(128) NULL AFTER `id_customer`' ], [ 'query' => ['table' => 'axepta_customer_recurring_payment_card', 'column' => 'holder_name'], 'sql' => 'axepta_customer_recurring_payment_card` ADD `holder_name` VARCHAR(128) NULL AFTER `id_customer`' ], [ 'query' => ['table' => 'axepta_transaction', 'column' => 'scheme_reference_id'], 'sql' => 'axepta_transaction` ADD `scheme_reference_id` VARCHAR(255) NULL' ], [ 'query' => ['table' => 'axepta_customer_payment_recurring', 'column' => 'scheme_reference_id'], 'sql' => 'axepta_customer_payment_recurring` ADD `scheme_reference_id` VARCHAR(255) NULL' ] ]; // Defaults values Configuration::updateGlobalValue('AXEPTA_MSG_VER', '2.0'); $sqlQueries = []; foreach ($data as $datum) { $query = ' SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME= "' . $datum['query']['column'] . '" AND TABLE_NAME= "'._DB_PREFIX_ . $datum['query']['table'] .'" AND TABLE_SCHEMA = "'._DB_NAME_.'" '; if (!Db::getInstance()->ExecuteS($query)) { $sqlQueries[] = 'ALTER TABLE `' . _DB_PREFIX_. $datum['sql']; } } if (AxeptaXml::paymentsNeedUpgrade()) { if (!AxeptaXml::insertXmlToDb()) { return false; } } foreach ($sqlQueries as $query) { if (Db::getInstance()->execute($query) == false) { return false; } } return true; }
💾 保存文件
← 返回文件管理器