changes for php7.4

This commit is contained in:
shreesh arora
2021-03-13 16:47:41 +05:30
parent 82b30db256
commit 86d6e1bbb6
5 changed files with 8 additions and 8 deletions

View File

@@ -1220,7 +1220,7 @@ class CartRuleCore extends ObjectModel
if ($type == 'shop') {
$shops = Context::getContext()->employee->getAssociatedShops();
if (count($shops)) {
$shop_list = ' AND t.id_shop IN ('.implode(array_map('intval', $shops), ',').') ';
$shop_list = ' AND t.id_shop IN ('.implode(',', array_map('intval', $shops)).') ';
}
}

View File

@@ -236,7 +236,7 @@ class ReferrerCore extends ObjectModel
if ($implode) {
$sql = 'SELECT COUNT(id_order) AS orders, SUM(total_paid_real / conversion_rate) AS sales
FROM '._DB_PREFIX_.'orders
WHERE id_order IN ('.implode($implode, ',').')
WHERE id_order IN ('.implode(',', $implode).')
'.Shop::addSqlRestriction(Shop::SHARE_ORDER).'
AND valid = 1';
return Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);

View File

@@ -76,7 +76,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController
protected static function createCombinations($list)
{
if (count($list) <= 1) {
return count($list) ? array_map(create_function('$v', 'return (array($v));'), $list[0]) : $list;
return count($list) ? array_map(function ($v) {return (array($v));}, $list[0]) : $list;
}
$res = array();
$first = array_pop($list);

View File

@@ -719,7 +719,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
}
$this->tpl_form_vars['products_list'] = $products;
$this->tpl_form_vars['product_ids'] = implode($product_ids, '|');
$this->tpl_form_vars['product_ids'] = implode('|', $product_ids);
$this->tpl_form_vars['product_ids_to_delete'] = '';
$this->tpl_form_vars['supplier_id'] = $supply_order->id_supplier;
$this->tpl_form_vars['currency'] = $currency;

View File

@@ -1862,7 +1862,7 @@ class BlockLayered extends Module
break;
case 'manufacturer':
$query_filters_where .= ' AND p.id_manufacturer IN ('.implode($selected_filters['manufacturer'], ',').')';
$query_filters_where .= ' AND p.id_manufacturer IN ('.implode(',', $selected_filters['manufacturer']).')';
break;
case 'condition':
@@ -2005,7 +2005,7 @@ class BlockLayered extends Module
$this->products = array();
else
{
$product_per_page = isset($this->context->cookie->nb_item_per_page) ? (int)$this->context->cookie->nb_item_per_page : Configuration::get('PS_PRODUCTS_PER_PAGE');
$product_per_page = isset($this->context->cookie->nb_item_per_page) ? (int)$this->context->cookie->nb_item_per_page : Configuration::get('PS_PRODUCTS_PER_PAGE');
$n = (int)Tools::getValue('n', Configuration::get('PS_PRODUCTS_PER_PAGE'));
$nb_day_new_product = (Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20);
@@ -3049,8 +3049,8 @@ class BlockLayered extends Module
$query_filters = '';
else
{
array_walk($filter_value, create_function('&$id_manufacturer', '$id_manufacturer = (int)$id_manufacturer;'));
$query_filters = ' AND p.id_manufacturer IN ('.implode($filter_value, ',').')';
array_walk($filter_value, function (&$id_manufacturer) {$id_manufacturer = (int)$id_manufacturer;});
$query_filters = ' AND p.id_manufacturer IN ('.implode(',', $filter_value).')';
}
if ($ignore_join)
return array('where' => $query_filters);