From 000ff61dd8a88eb875048e6a3deca8679d75df18 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 29 八月 2020 11:29:33 +0800
Subject: [PATCH] 2020-08-29

---
 src/utils/utils.js |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/utils/utils.js b/src/utils/utils.js
index e033b10..19cc904 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -689,7 +689,7 @@
     arrfield = arrfield.join(',')
 
     if (item.orderBy) {
-      sql = 'select distinct ' + arrfield + ',' + item.orderBy + ' as orderfield from ' + _datasource + ' order by orderfield ' + item.orderType
+      sql = `select ${arrfield} from (select distinct ${arrfield},${item.orderBy} as orderfield from ${_datasource} ) a order by orderfield ${item.orderType}`
     } else {
       sql = 'select distinct ' + arrfield + ' from ' + _datasource
     }
@@ -948,8 +948,7 @@
         
         aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`
 
-      // if (window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') {
-      if (window.GLOB.systemType !== 'production') {
+      if ((window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') || window.debugger === true) {
         let fsql = `
         ${_sql}
         ${_sqlInsert}
@@ -1582,8 +1581,7 @@
     _sql += `
         aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg`
 
-    // if (window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') {
-    if (window.GLOB.systemType !== 'production') {
+    if ((window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') || window.debugger === true) {
       _sql = _sql.replace(/\n\s{8}/ig, '\n')
       console.log(_sql)
     }

--
Gitblit v1.8.0