constthisLast=newDate(year,month+1,0);//이번 달의 마지막 날
constdb=awaitgetDb();
constdb=awaitgetDb();
returnnewPromise((res,rej)=>{
returnnewPromise((res,rej)=>{
db.transaction(async(tx)=>{
db.transaction(async(tx)=>{
console.log('월간 데이터');
console.log('월간 데이터');
const[txn,results]=awaittx.executeSql('SELECT * FROM money WHERE date BETWEEN "2021-07-01" AND "2021-07-31"');
const[txn,results]=awaittx.executeSql(`SELECT date, type_id, sum(price) as total from money where date BETWEEN "${String(thisFirst.toJSON()).split(/T/)[0]}" and "${String(thisLast.toJSON()).split(/T/)[0]}" group by date, type_id`);
constthisLast=newDate(year,month+1,0);//이번 달의 마지막 날
constdb=awaitgetDb();
returnnewPromise((res,rej)=>{
db.transaction(async(tx)=>{
console.log('차트 페이지');
const[txn,results]=awaittx.executeSql(`SELECT category_id, sum(price) as total from (SELECT type, price, category from money where date BETWEEN "${String(thisFirst.toJSON()).split(/T/)[0]}" and "${String(thisLast.toJSON()).split(/T/)[0]}") WHERE type='지출' group by category`);