-1
如何从控制器传递多维数组以查看codeigniter中的数据。 在控制器中获取输出,但在传递给控制器时发生错误。 我的阵列结果:如何访问codeigniter中的多维数组
Array (
[0] => Array ([PcountID] => 1 [PcountNAME] => Abayas [Pcount] => 8 [ScountID] => 1 [ScountNAME] => Abayas [Scount] => 9)
[1] => Array ([PcountID] => 3 [PcountNAME] => Hytaf [Pcount] => 16 [ScountID] => 3 [ScountNAME] => Hytaf [Scount] => 13)
[2] => Array ([PcountID] => 5 [PcountNAME] => Rida [Pcount] => 2 [ScountID] => 6 [ScountNAME] => sss [Scount] => 3)
[3] => Array ([PcountID] => 6 [PcountNAME] => sss [Pcount] => 7)
)
我的控制器的代码:
for($i = 0 ; $i<$CinventoryP; $i++)
{
for($j = 0; $j<$CinventoryPR; $j++)
{
if($inventoryP[$i]['product_id'] == $inventoryPR[$j]['product_id'])
{
$jj = $j;
$flag = 1;
break;
}
else{
$flag=0;
$jj = $j;
}
}
if($flag==1)
{
$outs[$i]['PcountID'] = $inventoryP[$i]['product_id'];
$outs[$i]['PcountNAME'] = $inventoryP[$i]['product_name'];
$outs[$i]['Pcount'] = $inventoryP[$i]['purchase_count'] - $inventoryPR[$jj]['purchase_returns_count'];
}
else{
$outs[$i]['PcountID'] = $inventoryP[$i]['product_id'];
$outs[$i]['PcountNAME'] = $inventoryP[$i]['product_name'];
$outs[$i]['Pcount'] = $inventoryP[$i]['purchase_count']."<br>";
}
}
$this->load->view('inventory/view_inventory_report',$out);
如何在视图中访问此类型的阵列结果的。请帮忙。