caipin il y a 5 ans
Parent
commit
64001ec2fb
1 fichiers modifiés avec 4 ajouts et 3 suppressions
  1. 4 3
      app/models/operate_log.js

+ 4 - 3
app/models/operate_log.js

@@ -52,9 +52,10 @@ module.exports = (sequelize, DataTypes) => {
         'logType=? and dataId=? GROUP BY Year(createDate) ';
         sequelize.query(sqlQuery,
         		  { replacements: [logType,dataId], type: sequelize.QueryTypes.SELECT }
-        		).then(function(projects) {
-        			list=projects;
-        		})
+        		).spread((results, metadata) => {
+                    list=results;
+                    console.log(list);
+                });
         
 //        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 ' +