wuggemail@foxmail.com 3 hónapja
szülő
commit
595949cdbf
1 módosított fájl, 7 hozzáadás és 3 törlés
  1. 7 3
      app/cxinv/controller/FinancialManager.php

+ 7 - 3
app/cxinv/controller/FinancialManager.php

@@ -314,9 +314,13 @@ class FinancialManager extends Base{
             "goodNo"=>"","inv_number"=>"","inv_buyer_code"=>"",'inv_seller_code'=>"",'channel'=>[1],'status'=>"","start"=>"","end"=>"",
             "page"=>1,"size"=>15],"post","trim");
     $where=[];
+    $headeIndex =0;
     if($param['code']!="") $where[]= ["code","=","%{$param['code']}%"];
     if(!empty($param['type'])) $where[]= ["type","in",$param['type']];
-    if(!empty($param['channel'])) $where[]= ["channel","in",$param['channel']];
+    if(!empty($param['channel'])) {
+        $where[]= ["channel","in",$param['channel']];
+        if(in_array(3,$param['channel']))  $headeIndex =2;
+    }
     if($param['status']!="") $where[]= ["status","in",$param['status']];
     if($param['start']!="") $where[]= ["create_time",">=",startTime($param['start'])];
     if($param['end']!="") $where[]= ["create_time","<=",endTime($param['end'])];
@@ -352,7 +356,7 @@ class FinancialManager extends Base{
         ];
 
     $list = $this->model
-        ->field($fields[$param['channel']-1])
+        ->field($fields[$headeIndex])
         ->where($where)
         ->order("id desc")
         ->select()->each(function (&$item){
@@ -361,6 +365,6 @@ class FinancialManager extends Base{
            $item['goodType'] = \app\cxinv\model\FinancialManager::$ManagerGoodType[$item['goodType']]??"";
            if(isset($item['inv_type'])) $item['inv_type'] =\app\cxinv\model\Invoice::$invoiceType[$item['inv_type']]??"";
         })->toArray();
-    exportExcel($list,$heade[$param['channel']-1],"manager");
+    exportExcel($list,$heade[$headeIndex],"manager");
     }
 }