diff --git a/app/admin/controller/Config.php b/app/admin/controller/Config.php
index c2db15930..4f3247689 100755
--- a/app/admin/controller/Config.php
+++ b/app/admin/controller/Config.php
@@ -51,6 +51,7 @@ class Config extends Common
{
// 静态数据
MyViewAssign('common_excel_charset_list', MyConst('common_excel_charset_list'));
+ MyViewAssign('common_excel_export_type_list', MyConst('common_excel_export_type_list'));
MyViewAssign('common_is_enable_list', MyConst('common_is_enable_list'));
MyViewAssign('common_login_type_list', MyConst('common_login_type_list'));
MyViewAssign('common_close_open_list', MyConst('common_close_open_list'));
diff --git a/app/admin/view/default/config/index.html b/app/admin/view/default/config/index.html
index 1faa93a10..1b9d3debd 100755
--- a/app/admin/view/default/config/index.html
+++ b/app/admin/view/default/config/index.html
@@ -19,6 +19,14 @@
{{/foreach}}
+
+
+
+
diff --git a/app/service/ConstService.php b/app/service/ConstService.php
index d6441b002..762dd65b3 100644
--- a/app/service/ConstService.php
+++ b/app/service/ConstService.php
@@ -140,7 +140,7 @@ class ConstService
],
// 状态
- 'common_state_list' => [
+ 'common_state_list' => [
0 => ['id' => 0, 'name' => '不可用'],
1 => ['id' => 1, 'name' => '可用', 'checked' => true],
],
@@ -151,6 +151,12 @@ class ConstService
1 => ['id' => 1, 'value' => 'gbk', 'name' => 'gbk'],
],
+ // excel导出类型列表
+ 'common_excel_export_type_list' => [
+ 0 => ['id' => 0, 'name' => 'CSV', 'checked' => true],
+ 1 => ['id' => 1, 'name' => 'Excel'],
+ ],
+
// 支付支付状态
'common_order_pay_status' => [
0 => ['id' => 0, 'name' => '待支付', 'checked' => true],
diff --git a/extend/base/Excel.php b/extend/base/Excel.php
index bda7974a4..7ae59f6b7 100755
--- a/extend/base/Excel.php
+++ b/extend/base/Excel.php
@@ -81,7 +81,34 @@ class Excel
}
/**
- * 导出CSV文件
+ * 文件导出
+ * @author Devil
+ * @blog http://gong.gg/
+ * @version 0.0.1
+ * @datetime 2017-01-10T15:12:01+0800
+ */
+ public function Export()
+ {
+ // 是否有数据
+ if(empty($this->title) && empty($this->data))
+ {
+ echo '';
+ echo '';
+ die;
+ }
+
+ // 导出类型
+ $export_type = MyC('common_excel_export_type', 0, true);
+ if($export_type == 0)
+ {
+ $this->ExportCsv();
+ } else {
+ $this->ExportExcel();
+ }
+ }
+
+ /**
+ * csv导出文件
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
@@ -167,7 +194,7 @@ class Excel
* @version 0.0.1
* @datetime 2017-01-10T15:12:01+0800
*/
- public function Export()
+ public function ExportExcel()
{
// 是否有数据
if(empty($this->title) && empty($this->data))