modules/query/TripsTable.js
function _buildEffectiveServiceIDString(db, date, callback) {

  // Query the Calendar for effective services
  CalendarTable.getServicesEffective(db, date, function(err, services) {

    // Database Query Error
    if ( err ) {
      return callback(err);
    }

    // Build Service ID String
    let serviceIds = [];
    for ( let i = 0; i < services.length; i++ ) {
      serviceIds.push(services[i].id);
    }
    let serviceIdString = "('" + serviceIds.join("', '") + "')";

    // Return Service ID String
    return callback(null, serviceIdString);

  });

}
function _buildEffectiveServiceIDString(db, date, callback) {

  // Query the Calendar for effective services
  CalendarTable.getServicesEffective(db, date, function(err, services) {

    // Database Query Error
    if ( err ) {
      return callback(err);
    }

    // Build Service ID String
    let serviceIds = [];
    for ( let i = 0; i < services.length; i++ ) {
      serviceIds.push(services[i].id);
    }
    let serviceIdString = "('" + serviceIds.join("', '") + "')";

    // Return Service ID String
    return callback(null, serviceIdString);

  });

}
function _buildEffectiveServiceIDString ( db , date , callback ) { // Query the Calendar for effective services CalendarTable . getServicesEffective ( db , date , function ( err , services ) { // Database Query Error if ( err ) { return callback ( err ) ; } // Build Service ID String let serviceIds = [ ] ; for ( let i = 0 ; i < services . length ; i ++ ) { serviceIds . push ( services [ i ] . id ) ; } let serviceIdString = "('" + serviceIds . join ( "', '" ) + "')" ; // Return Service ID String return callback ( null , serviceIdString ) ; } ) ; }
Build the Effective Service ID String for SELECT query
@param {RightTrackDB} db The Right Track DB to query
@param {int} date Date Integer (yyyymmdd)
@param {function} callback Callback function(err, serviceIdString)
@private
Build the Effective Service ID String for SELECT query