29 lines
		
	
	
		
			952 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			952 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
| <?php
 | |
| namespace IpSupply\CartToQuote\Block\Customer\History;
 | |
| 
 | |
| class Detail extends \Magento\Framework\View\Element\Template
 | |
| {       
 | |
|     protected  $carttDetailFactory;
 | |
|     public function __construct(
 | |
|         \Magento\Backend\Block\Template\Context $context, 
 | |
|         \IpSupply\CartToQuote\Model\CartDetailFactory $carttDetailFactory,       
 | |
|         array $data = []
 | |
|     )
 | |
|     {  
 | |
|         $this->carttDetailFactory =  $carttDetailFactory;    
 | |
|         parent::__construct($context, $data);
 | |
|     }
 | |
| 
 | |
|     public function getItems($customerId)
 | |
|     {
 | |
|         $id = (int) $this->getRequest()->getParam('id');
 | |
|         $collection = $this->carttDetailFactory->create()->getCollection();
 | |
|         $data = $collection->addFieldToFilter('quote_history_id', ['eq' => $id])
 | |
|             ->addFieldToFilter('customer_id', ['eq' => $customerId])
 | |
|             ->setOrder('name','DESC')
 | |
|             ->getData();
 | |
|         return $data;
 | |
|     }
 | |
| 
 | |
| }
 | |
| ?>
 |