caipin 5 年 前
コミット
4037742fa1
1 ファイル変更13 行追加2 行削除
  1. 13 2
      app/models/operate_log.js

+ 13 - 2
app/models/operate_log.js

@@ -52,11 +52,22 @@ module.exports = (sequelize, DataTypes) => {
         'logType=? and dataId=? GROUP BY Year(createDate) ';
         sequelize.query(sqlQuery,
         		  { replacements: [logType,dataId], type: sequelize.QueryTypes.SELECT }
-        		).spread((results, metadata) => {
+        		).then(function(projects) {
+        			list=results;
+        		})
+        console.log(list);
+        /*
+         
+         .spread((results, metadata) => {
                     list=results;
                     
                 });
-        console.log(list);
+         
+         .then(function(projects) {
+    			list=results;
+    		})
+         */
+        
 //        var list=[];
 //        await this.sequelize.query('select  CONVERT(GROUP_CONCAT(id) USING utf8)   as id,date_format(createDate,"%Y") as year FROM operate_log where ' +
 //            'logType='+logType+' and dataId='+dataId+' GROUP BY Year(createDate) ').spread((results, metadata) => {