rabin 1 year ago
parent
commit
08ad282306

+ 40 - 36
boot.php

@@ -53,6 +53,7 @@ if (isset($_SERVER['HTTP_HOST'])) {
 } else {
 	define('DEVER_APP_HOST', '');
 }
+
 /*
 |--------------------------------------------------------------------------
 | autoload
@@ -71,39 +72,42 @@ if (is_file(DEVER_PATH . 'build/dever.phar1')) {
 if (is_file(DEVER_PROJECT_PATH . 'vendor/autoload.php')) {
 	require DEVER_PROJECT_PATH . 'vendor/autoload.php';
 }
-/*
-|--------------------------------------------------------------------------
-| init config
-|--------------------------------------------------------------------------
-*/
-Dever\Loader\Config::init();
-/*
-|--------------------------------------------------------------------------
-| load debug
-|--------------------------------------------------------------------------
-*/
-if (Dever\Loader\Config::get('debug')->error) {
-	Dever\Output\Debug::report();
-}
-/*
-|--------------------------------------------------------------------------
-| project register
-|--------------------------------------------------------------------------
-*/
-Dever\Loader\Project::register();
-/*
-|--------------------------------------------------------------------------
-| route
-|--------------------------------------------------------------------------
-*/
-$route = new Dever\Routing\Route;
-/*
-|--------------------------------------------------------------------------
-| route run and out
-|--------------------------------------------------------------------------
-*/
-if (!defined('DEVER_DAEMON')) {
-	$route->runing()->output();
-}
-$route->close();
-$route = null;
+
+if (defined('DEVER_APP_NAME')) {
+	/*
+	|--------------------------------------------------------------------------
+	| init config
+	|--------------------------------------------------------------------------
+	*/
+	Dever\Loader\Config::init();
+	/*
+	|--------------------------------------------------------------------------
+	| load debug
+	|--------------------------------------------------------------------------
+	*/
+	if (Dever\Loader\Config::get('debug')->error) {
+		Dever\Output\Debug::report();
+	}
+	/*
+	|--------------------------------------------------------------------------
+	| project register
+	|--------------------------------------------------------------------------
+	*/
+	Dever\Loader\Project::register();
+	/*
+	|--------------------------------------------------------------------------
+	| route
+	|--------------------------------------------------------------------------
+	*/
+	$route = new Dever\Routing\Route;
+	/*
+	|--------------------------------------------------------------------------
+	| route run and out
+	|--------------------------------------------------------------------------
+	*/
+	if (!defined('DEVER_DAEMON')) {
+		$route->runing()->output();
+	}
+	$route->close();
+	$route = null;
+}

+ 2 - 2
vendor/dever-main/framework/src/Dever/Pagination/Paginator.php

@@ -216,8 +216,8 @@ class Paginator
         }
         $this->array = array
         (
-            'total' => $total,
-            'current_page' => $current,
+            'total' => intval($total),
+            'current_page' => intval($current),
             'total_page' => $totalPage,
             'next_page' => $next,
             'prev_page' => $this->prev(),

+ 4 - 7
vendor/dever-main/framework/src/Dever/Support/Excel.php

@@ -41,6 +41,10 @@ class Excel
      */
     public static function export($data = array(), $header = array(), $fileName = '', $sheet = 0, $sheetName = '', $return = false, $xls = false, $method = false)
     {
+        $type = Dever::input('excel_type');
+        if ($type == 1) {
+            return array('body' => $data, 'head' => $header, 'filename' => $fileName);
+        }
         if (!$method) {
             if (Dever::project('excel')) {
                 Dever::apply('src/PHPExcel', 'excel');
@@ -158,10 +162,6 @@ class Excel
         }
 
         if($data) {
-            $total = count($data);
-            if ($total >= 300) {
-                echo '数据过多,请筛选后导出';die;
-            }
             $i = 0;
             $height = $max = 80;
             if (Dever::config('host')->project && isset(Dever::config('host')->project['upload'])) {
@@ -298,9 +298,6 @@ class Excel
         $limit = 100000;
         //逐行取出数据,不浪费内存
         $count = count($data);
-        if ($count >= 1000) {
-            echo '数据过多,请筛选后导出';die;
-        }
         if ($count > 0) {
             for ($i = 0; $i < $count; $i++) {
                 if (isset($data[$i])) {