From 6011e266592a47f4099d963d34ecba4c4ee38f73 Mon Sep 17 00:00:00 2001 From: Edward Date: Mon, 7 Jan 2019 15:07:32 +0800 Subject: [PATCH] Pman/Roo.php --- Pman/Roo.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Pman/Roo.php b/Pman/Roo.php index 362dfb7..78c897f 100644 --- a/Pman/Roo.php +++ b/Pman/Roo.php @@ -502,7 +502,23 @@ class Pman_Roo extends Pman //echo "
"; print_r(array($_REQUEST['csvCols'], $x->toArray())); exit;
             $line = array();
             
+            if ($cols== '*') {
+                $cols= array_keys($x);
+            }
+            
+            if(!is_array($cols)) {
+                $cols = explode(',', $cols);
+            }
+
             if ($titles !== false) {
+                if ($titles== '*') {
+                    $titles= array_keys($x);
+                }
+
+                if(!is_array($titles)) {
+                    $titles = explode(',', $titles);
+                }
+
                 foreach($cols as $i=>$col) {
                     $se_config['cols'][] = array(
                         'header'=> isset($titles[$i]) ? $titles[$i] : $col,
@@ -522,17 +538,15 @@ class Pman_Roo extends Pman
                 $titles = false;
             }
             
-            
-            
             $se->addLine($se_config['workbook'], $x);
         }
+        
         if(!$se){
             $this->jerr('no data found');
         }
+        
         $se->send($fn .'.xls');
         exit;
-    
-        
         
     }
     
-- 
2.39.2