Esempio n. 1
0
 public function getpricelistAction()
 {
     // 请求参数
     $request = $this->getRequest()->getParams();
     $option = isset($request['option']) ? $request['option'] : 'list';
     $condition = array('key' => isset($request['key']) && $request['key'] != '' ? $request['key'] : null, 'partner_type' => isset($request['partner_type']) && $request['partner_type'] != 'null' ? $request['partner_type'] : null, 'supplier_id' => isset($request['supplier_id']) && $request['supplier_id'] != 'null' ? $request['supplier_id'] : null, 'page' => isset($request['page']) ? $request['page'] : 1, 'limit' => isset($request['limit']) ? $request['limit'] : 0, 'type' => $option);
     //echo '<pre>';print_r($condition);exit;
     if ($condition['partner_type'] != null) {
         $pricelist = new Erp_Model_Warehouse_Pricelist();
         $data = $pricelist->getData($condition);
         if ($option == 'csv') {
             $this->view->layout()->disableLayout();
             $this->_helper->viewRenderer->setNoRender(true);
             $h = new Application_Model_Helpers();
             $h->exportCsv($data, '价格清单');
         } else {
             echo Zend_Json::encode($data);
         }
     }
     exit;
 }