Your Name 2 years ago
parent
commit
7f09988bac
2 changed files with 4 additions and 42 deletions
  1. 1 4
      app/cash/database/order.php
  2. 3 38
      app/cash/lib/Order.php

+ 1 - 4
app/cash/database/order.php

@@ -374,10 +374,7 @@ return array
         'edit' => false,
         'insert' => false,
         // 'excel'	=> true,
-        'button' => array
-        (
-            '数据导出' => array('excel', 'cash/lib/order.out_order'),
-        ),
+        'excel' => array('数据导出', '结算单数据列表','cash/lib/order.out_order');
 
         'page_list' => 'order_list',
 

+ 3 - 38
app/cash/lib/Order.php

@@ -121,42 +121,7 @@ class Order
         }
     }
     #导出Excel
-    public function out_order_api(){
-        $start = Dever::input('search_option_start_operdate');
-        $end = Dever::input('search_option_start_operdate');
-        $type = Dever::input('search_option_type');
-        $pay_type = Dever::input('search_option_pay_type');
-        $audit = Dever::input('search_option_audit');
-        $status = Dever::input('search_option_status');
-        $jstype = Dever::input('search_option_jstype');
-        $type_id = Dever::input('search_option_type_id');
-        $where = array();
-        if($start){
-            $where['start'] = $start;
-        }
-        if($end){
-            $where['end'] = $end;
-        }
-        if($type){
-            $where['type'] = $type;
-        }
-        if($pay_type){
-            $where['pay_type'] = $pay_type;
-        }
-        if($audit){
-            $where['audit'] = $audit;
-        }
-        if($status){
-            $where['status'] = $status;
-        }
-        if($jstype){
-            $where['jstype'] = $jstype;
-        }
-        if($type_id){
-            $where['type_id'] = $type_id;
-        }
-        $where['state'] = 1;
-        $data = Dever::db('cash/order')->getExcel($where);
+    public function out_order_api($data){
         $header = array('ID', '结算单号', '结算门店', '订货单编号', '数量', '结算金额', '结算类型', '入账状态', '审核状态', '支付类型', '结算时间','审核备注','生成时间');
         $body = array();
         foreach($data as $k => $v){
@@ -210,7 +175,7 @@ class Order
             );
             $body[] = $d;
         }
-        $file = '结算单数据列表';
-        Dever::excelExport($body, $header, $file);
+        $file = Dever::input('excel_name');
+        return Dever::excelExport($body, $header, $file);
     }
 }