Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- const sql = require('../util/db.js');
- //Vibe object constructor
- const Vibe = function(task){
- this.task = task.task;
- this.status = task.status;
- };
- Vibe.queryVibe = function getAllSuccess(res)
- {
- sql.query(`Select count(*) as total from mfmbs.funds_transfer_transaction`, function (err, total) {
- if(err) {
- console.log("error: ", err);
- res(null, err);
- }
- else{
- console.log(total[0].total);
- //res(null, task);
- }
- });
- sql.query("SELECT count(*) as fail FROM mfmbs.funds_transfer_transaction where DATE(FTTRANTIME)=DATE(NOW()) and ERRMSG LIKE '%Core banking down%'", function (err, fail) {
- if(err){
- console.log("error: ", err);
- res(null, err);
- }else{
- console.log(fail[0].fail);
- // res(null, fail);
- }
- });
- sql.query("SELECT count(*) as allToday FROM mfmbs.funds_transfer_transaction where DATE(FTTRANTIME)=DATE(NOW())", function (err, allToday) {
- if(err){
- console.log("error: ", err);
- res(null, err);
- }else{
- console.log(allToday[0].allToday);
- //res(null, allToday);
- }
- });
- sql.query("SELECT count(*) as success FROM mfmbs.funds_transfer_transaction where DATE(FTTRANTIME)=DATE(NOW()) and FTRESULT='Success'", function (err, success) {
- if(err){
- console.log("error: ", err);
- res(null, err);
- }else{
- console.log(success[0].success);
- //res(null, success);
- }
- });
- };
- module.exports= Vibe;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement