警告:implode():header.php中传递的参数无效

时间:2016-04-20 03:42:58

标签: php arrays opencart opencart2.x

安装我的扩展程序后,我在管理页面中看到此错误:

  

警告:implode():在第58行的/Applications/XAMPP/xamppfiles/htdocs/store/admin/controller/common/header.php中传递的参数无效   警告:implode():第59行的/Applications/XAMPP/xamppfiles/htdocs/store/admin/controller/common/header.php中传递的参数无效   警告:implode():在第62行的/Applications/XAMPP/xamppfiles/htdocs/store/admin/controller/common/header.php中传递的参数无效   警告:implode():在第63行的/Applications/XAMPP/xamppfiles/htdocs/store/admin/controller/common/header.php中传递的参数无效

的header.php

    // Processing Orders
    $data['order_status_total'] = $this->model_sale_order->getTotalOrders(array('filter_order_status' => implode(',', $this->config->get('config_processing_status'))));
    $data['order_status'] = $this->url->link('sale/order', 'token=' . $this->session->data['token'] . '&filter_order_status=' . implode(',', $this->config->get('config_processing_status')), 'SSL');

    // Complete Orders
    $data['complete_status_total'] = $this->model_sale_order->getTotalOrders(array('filter_order_status' => implode(',', $this->config->get('config_complete_status'))));
    $data['complete_status'] = $this->url->link('sale/order', 'token=' . $this->session->data['token'] . '&filter_order_status=' . implode(',', $this->config->get('config_complete_status')), 'SSL');
数据库中的

(complete_status_total):

a:1:{i:0;s:1:"7";}

我该如何解决此错误?!

1 个答案:

答案 0 :(得分:2)

您需要unserialize那个。

例如:

$data = 'a:1:{i:0;s:1:"7";}'
$unserialized_data = unserialize($data); //Unserialized string to array
print_r($unserialized_data);

$imploded_data = implode(',', unserialized_data); //Implode your array
echo $imploded_data;