如何在magento中创建新的自定义报告?我创建了自己的,但他正在寻找错误的tempalte,继续寻找grid.php aquivo的核心,我怎么能告诉他得到我的grid.php文件?这可能是代码:
<?xml version="1.0"?>
<layout version="0.1.0">
<reportneworders_adminhtml_reportneworders_index>
<adminhtml_report_statistics_index>
<reference name="content">
<block type="adminhtml/report_refresh_statistics" template="tagon/report/refresh/statistics.phtml" name="myrefreshstatistics" />
</reference>
</adminhtml_report_statistics_index>
<reference name="content">
<block type="reportneworders/adminhtml_reportneworders" name="mycontainer" template="tagon/report/grid/container.phtml">
</block>
</reference>
</reportneworders_adminhtml_reportneworders_index>
</layout>
答案 0 :(得分:0)
嗯,改变不会发生,因为方法&#34;得到Html Grid&#34;正在寻找动态设置的magento模板,更改应该在_prepareLayout重写方法中完成,如下所示。
<?php
$arrayResult = array();
foreach($inputData as $someInput){
if(!isset($arrayResult[$someInput->id])){
$current = new stdClass();
$current->id = $someInput->id;
$current->x = $someInput->x;
$current->y = $someInput->y;
$current->total = $someInput->total;
$arrayResult[$someInput->id] = $current;
}else{
$current = $arrayResult[$someInput->id];
$current->x += $someInput->x;
$current->y += $someInput->y;
$current->total += $someInput->total;
$arrayResult[$someInput->id] = $current;
}
}
$arrayResult = array_values($arrayResult);
?>