변경했습니다. app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php주문을 사용자 정의하려면 그리드를 주문하십시오. _getCollectionClass()
에서Magento - SQLSTATE [42S22] : 열을 찾을 수 없음 : 1054 알 수없는 'where 절에'billing_name '열
나는이 있습니다
protected function _getCollectionClass()
{
//return 'sales/order_grid_collection';
return 'sales/order_collection';
}
및 _prepareCollection()
에 나는이 있습니다
protected function _prepareCollection()
{
$collection = Mage::getResourceModel($this->_getCollectionClass());
$collection->getSelect()->joinLeft(array('s1' => 'sales_flat_order_address'),'main_table.shipping_address_id = s1.entity_id',array('region','firstname','lastname'));
$collection->getSelect()->joinLeft(array('s2'=>'sales_flat_order_address'),'main_table.billing_address_id = s2.entity_id',array('firstname','lastname'));
$collection->getSelect()->columns(new Zend_Db_Expr("CONCAT(s2.firstname, ' ',s2.lastname) AS billing_name"));
$collection->getSelect()->columns(new Zend_Db_Expr("CONCAT(s1.firstname, ' ',s1.lastname) AS shipping_name"));
$collection->getSelect()->joinLeft(array('sfo'=>'sales_flat_order'),'sfo.entity_id=main_table.entity_id',array('sfo.customer_email','sfo.weight','sfo.discount_description','sfo.increment_id','sfo.store_id','sfo.created_at','sfo.status','sfo.base_grand_total','sfo.grand_total')); // New
$collection->getSelect()->joinLeft(array('sfoa'=>'sales_flat_order_address'),'main_table.entity_id = sfoa.parent_id AND sfoa.address_type="shipping"',array('sfoa.street','sfoa.city','sfoa.region','sfoa.postcode','sfoa.telephone')); // New
$this->setCollection($collection);
return parent::_prepareCollection();
}
지금 내가 필요한 필드를 추가 할 _prepareColumns()
를 변경 한 모든 위대한 작품! 한 가지 ...을 제외하고
내가 배송청구 또는 에 의해 주문을 검색
, 나는 오류가 발생합니다. 나는 필요한 모든 구성 요소에 filter_index 년대 ('filter_index' => 'theindex'
)을 추가 한 그들은 모두 또는
이 배송이 두 필드
청구를 제외하고 잘 작동. 그래서 나는 filter_index도 입력했습니다.
모든 것이 멋지게 나옵니다. 나는 다른 필드를 검색 할 수 있지만 최대한 빨리 또는 이 필드 배송 청구를 검색, 나는이 오류 얻을 : 나는 모든 종류의 것들을 시도했지만 아무것도 작동하는 것 같다되지
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'billing_name' in 'where clause'
합니다. 누군가 제발 도와 줄 수 있어요! ???