Skip to content

Commit

Permalink
- update code of select_latest_resource
Browse files Browse the repository at this point in the history
  • Loading branch information
IoTKETI committed Nov 28, 2019
1 parent 8236aa1 commit ff282e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mobius/sql_action.js
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ exports.select_latest_resource = function(connection, parentObj, loop_count, lat
}

var before_ct = moment().subtract(Math.pow(5, loop_count), 'minutes').utc().format('YYYYMMDDTHHmmss');
var query_where = ' and ';
var query_where = ' and ty = \'' + (parseInt(parentObj.ty, 10) + 1).toString() + '\' and ';
query_where += util.format(' (\'%s\' < ct) order by ri desc limit 10', before_ct);

var sql = 'select * from (select * from lookup where (pi = \'' + parentObj.ri + '\') ' + query_where + ')b join ' + responder.typeRsrc[parseInt(parentObj.ty, 10) + 1] + ' as a on b.ri = a.ri';
Expand Down

0 comments on commit ff282e3

Please sign in to comment.