caipin 5 lat temu
rodzic
commit
375f804a11
2 zmienionych plików z 4 dodań i 11 usunięć
  1. 3 3
      app/models/client.js
  2. 1 8
      app/models/operate_log.js

+ 3 - 3
app/models/client.js

@@ -108,10 +108,10 @@ client.findById=async function(cid,attributes){
     var staffDetail=[];
 
     var sqlQuery = 'SELECT b.* FROM CLD_client_staff as a left join CLD_staff as b on (a.sid=b.sid) where a.cid=?';
-    sequelize.query(sqlQuery,
+    await sequelize.query(sqlQuery,
     		  { replacements: [cid], type: sequelize.QueryTypes.SELECT }
-    		).then(function(projects) {
-    			staffDetail=projects[0];
+    		).then(function(results) {
+    			staffDetail=results[0];
     		})
 
 //    await this.sequelize.query('SELECT b.* FROM CLD_client_staff as a left join CLD_staff as b on (a.sid=b.sid) where a.cid=7').spread((results, metadata) => {

+ 1 - 8
app/models/operate_log.js

@@ -55,9 +55,8 @@ module.exports = (sequelize, DataTypes) => {
         		).then(function(results) {
         			list=results;
         		})
-        console.log(list);
+        
         /*
-         
          .spread((results, metadata) => {
                     list=results;
                     
@@ -67,12 +66,6 @@ module.exports = (sequelize, DataTypes) => {
     			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) => {
-//            list=results;
-//        });
 
         var sqlArray=[];
         list.forEach(function(v,i){