![](/img/trans.png)
[英]$collection->setPage(0,5) returning all products in magento 1.9
[英]Magento $collection->join - Multiple
我目前正在擴展Magento發票網格以顯示一些其他列。 我已經獲得了最需要的數據,但是我很難從同一個數據庫表中獲得1列以上的數據。
這就是我的_prepareCollection
$collection->join('invoice','main_table.entity_id=invoice.entity_id','subtotal');
$collection->join('invoice','main_table.entity_id=invoice.entity_id','discount_description');
我認為我需要刪除第二行並將它們放入某種數組中,我不確定如何做到這一點,因為我對PHP的使用不太多。
謝謝。
哦,這比我預期的要簡單得多,我設法解決了以下問題:
$collection->join('invoice', 'main_table.entity_id = invoice.entity_id', array(
'subtotal',
'discount_description'
));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.