diff --git a/src/app/mock-api/apps/report/today-bet/api.ts b/src/app/mock-api/apps/report/today-bet/api.ts index 3217c89..583a03f 100644 --- a/src/app/mock-api/apps/report/today-bet/api.ts +++ b/src/app/mock-api/apps/report/today-bet/api.ts @@ -2,6 +2,7 @@ import { Injectable } from '@angular/core'; import { assign, cloneDeep } from 'lodash-es'; import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api'; import { todayBets as todayBetsData } from './data'; +import { contacts } from '../../chat/data'; @Injectable({ providedIn: 'root', @@ -35,27 +36,10 @@ export class ReportTodayBetMockApi { const search = request.params.get('search'); const sort = request.params.get('sort') || 'name'; const order = request.params.get('order') || 'asc'; - const page = parseInt(request.params.get('page') ?? '1', 10); - const size = parseInt(request.params.get('size') ?? '10', 10); // Clone the todayBets let todayBets: any[] | null = cloneDeep(this._todayBets); - // Sort the todayBets - if (sort === 'sku' || sort === 'name' || sort === 'active') { - todayBets.sort((a, b) => { - const fieldA = a[sort].toString().toUpperCase(); - const fieldB = b[sort].toString().toUpperCase(); - return order === 'asc' - ? fieldA.localeCompare(fieldB) - : fieldB.localeCompare(fieldA); - }); - } else { - todayBets.sort((a, b) => - order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] - ); - } - // If search exists... if (search) { // Filter the todayBets @@ -66,47 +50,11 @@ export class ReportTodayBetMockApi { ); } - // Paginate - Start - const todayBetsLength = todayBets.length; - - // Calculate pagination details - const begin = page * size; - const end = Math.min(size * (page + 1), todayBetsLength); - const lastPage = Math.max(Math.ceil(todayBetsLength / size), 1); - - // Prepare the pagination object - let pagination = {}; - - // If the requested page number is bigger than - // the last possible page number, return null for - // todayBets but also send the last possible page so - // the app can navigate to there - if (page > lastPage) { - todayBets = null; - pagination = { - lastPage, - }; - } else { - // Paginate the results by size - todayBets = todayBets.slice(begin, end); - - // Prepare the pagination mock-api - pagination = { - length: todayBetsLength, - size: size, - page: page, - lastPage: lastPage, - startIndex: begin, - endIndex: end - 1, - }; - } - // Return the response return [ 200, { todayBets, - pagination, }, ]; }); diff --git a/src/app/mock-api/apps/report/today-bet/data.ts b/src/app/mock-api/apps/report/today-bet/data.ts index 5a838b8..d998fcd 100644 --- a/src/app/mock-api/apps/report/today-bet/data.ts +++ b/src/app/mock-api/apps/report/today-bet/data.ts @@ -2,32 +2,518 @@ export const todayBets = [ { - id: 'on00', - totalPartnerCount: '5', - totalHoldingMoney: 303675, - totalComp: 108933, - total: 412608, - branchCount: 1, - divisionCount: 1, - officeCount: 1, - storeCount: 1, - memberCount: 1, - nickname: 'on00', - accountHolder: '11', - phoneNumber: '010-1111-1111', - calculateType: '롤링', - ownCash: 50000, - ownComp: 1711, - ownCoupon: 50000, - gameMoney: 0, - todayComp: 0, - totalDeposit: 0, - totalWithdraw: 0, - balance: 0, - registDate: '2022-06-12 15:38', - finalSigninDate: '', - ip: '', - state: '정상', - note: '', + user: { + id: '1', + signinId: 'kgon1', + type: '본사', + parentId: 0, + rank: '회원', + level: '4', + nickname: 'aa100', + }, + bank: { + users: { + deposit: '0', + withdraw: '0', + netProfit: 0, + }, + parthners: { + deposit: '0', + withdraw: '0', + netProfit: '0', + }, + totalNetProfit: '0', + passiveMoney: '0', + passiveComp: '0', + casino: { + betting: '382,000', + bettingTie: '33,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + slot: { + betting: '382,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + powerball: { + betting: '0', + bettingCancel: '0', + bettingValid: '0', + bettingWin: '0', + winLoss: '0', + commission: { + total: '0', + partner: '0', + me: '0', + }, + betWinSettle: '19,930', + }, + }, + totalBetSettle: '119,400', + }, + { + user: { + id: '2', + signinId: 'kgon2', + type: '대본', + parentId: 1, + }, + bank: { + users: { + deposit: '0', + withdraw: '0', + netProfit: 0, + }, + parthners: { + deposit: '0', + withdraw: '0', + netProfit: '0', + }, + totalNetProfit: '0', + passiveMoney: '0', + passiveComp: '0', + casino: { + betting: '382,000', + bettingTie: '33,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + slot: { + betting: '382,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + powerball: { + betting: '0', + bettingCancel: '0', + bettingValid: '0', + bettingWin: '0', + winLoss: '0', + commission: { + total: '0', + partner: '0', + me: '0', + }, + betWinSettle: '19,930', + }, + }, + totalBetSettle: '119,400', + }, + { + user: { + id: '3', + signinId: 'kgon1', + type: '본사', + parentId: 2, + }, + bank: { + users: { + deposit: '0', + withdraw: '0', + netProfit: 0, + }, + parthners: { + deposit: '0', + withdraw: '0', + netProfit: '0', + }, + totalNetProfit: '0', + passiveMoney: '0', + passiveComp: '0', + casino: { + betting: '382,000', + bettingTie: '33,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + slot: { + betting: '382,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + powerball: { + betting: '0', + bettingCancel: '0', + bettingValid: '0', + bettingWin: '0', + winLoss: '0', + commission: { + total: '0', + partner: '0', + me: '0', + }, + betWinSettle: '19,930', + }, + }, + totalBetSettle: '119,400', + }, + { + user: { + id: '4', + signinId: 'kgon1', + type: '부본', + parentId: 3, + }, + bank: { + users: { + deposit: '0', + withdraw: '0', + netProfit: 0, + }, + parthners: { + deposit: '0', + withdraw: '0', + netProfit: '0', + }, + totalNetProfit: '0', + passiveMoney: '0', + passiveComp: '0', + casino: { + betting: '382,000', + bettingTie: '33,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + slot: { + betting: '382,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + powerball: { + betting: '0', + bettingCancel: '0', + bettingValid: '0', + bettingWin: '0', + winLoss: '0', + commission: { + total: '0', + partner: '0', + me: '0', + }, + betWinSettle: '19,930', + }, + }, + totalBetSettle: '119,400', + }, + { + user: { + id: '5', + signinId: 'kgon1', + type: '본사', + parentId: 0, + }, + bank: { + users: { + deposit: '0', + withdraw: '0', + netProfit: 0, + }, + parthners: { + deposit: '0', + withdraw: '0', + netProfit: '0', + }, + totalNetProfit: '0', + passiveMoney: '0', + passiveComp: '0', + casino: { + betting: '382,000', + bettingTie: '33,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + slot: { + betting: '382,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + powerball: { + betting: '0', + bettingCancel: '0', + bettingValid: '0', + bettingWin: '0', + winLoss: '0', + commission: { + total: '0', + partner: '0', + me: '0', + }, + betWinSettle: '19,930', + }, + }, + totalBetSettle: '119,400', + }, + { + user: { + id: '6', + signinId: 'kgon1', + type: '본사', + parentId: 0, + }, + bank: { + users: { + deposit: '0', + withdraw: '0', + netProfit: 0, + }, + parthners: { + deposit: '0', + withdraw: '0', + netProfit: '0', + }, + totalNetProfit: '0', + passiveMoney: '0', + passiveComp: '0', + casino: { + betting: '382,000', + bettingTie: '33,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + slot: { + betting: '382,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + powerball: { + betting: '0', + bettingCancel: '0', + bettingValid: '0', + bettingWin: '0', + winLoss: '0', + commission: { + total: '0', + partner: '0', + me: '0', + }, + betWinSettle: '19,930', + }, + }, + totalBetSettle: '119,400', + }, + { + user: { + id: '7', + signinId: 'kgon1', + type: '본사', + parentId: 0, + }, + bank: { + users: { + deposit: '0', + withdraw: '0', + netProfit: 0, + }, + parthners: { + deposit: '0', + withdraw: '0', + netProfit: '0', + }, + totalNetProfit: '0', + passiveMoney: '0', + passiveComp: '0', + casino: { + betting: '382,000', + bettingTie: '33,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + slot: { + betting: '382,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + powerball: { + betting: '0', + bettingCancel: '0', + bettingValid: '0', + bettingWin: '0', + winLoss: '0', + commission: { + total: '0', + partner: '0', + me: '0', + }, + betWinSettle: '19,930', + }, + }, + totalBetSettle: '119,400', + }, + { + user: { + id: '8', + signinId: 'kgon1', + type: '본사', + parentId: 0, + }, + bank: { + users: { + deposit: '0', + withdraw: '0', + netProfit: 0, + }, + parthners: { + deposit: '0', + withdraw: '0', + netProfit: '0', + }, + totalNetProfit: '0', + passiveMoney: '0', + passiveComp: '0', + casino: { + betting: '382,000', + bettingTie: '33,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + slot: { + betting: '382,000', + bettingCancel: '0', + bettingValid: '351,000', + bettingWin: '357,050', + winLoss: '26,950', + commission: { + total: '7,020', + partner: '5,265', + me: '1,755', + }, + betWinSettle: '19,930', + }, + powerball: { + betting: '0', + bettingCancel: '0', + bettingValid: '0', + bettingWin: '0', + winLoss: '0', + commission: { + total: '0', + partner: '0', + me: '0', + }, + betWinSettle: '19,930', + }, + }, + totalBetSettle: '119,400', }, ]; diff --git a/src/app/modules/admin/report/today-bet/components/list.component.html b/src/app/modules/admin/report/today-bet/components/list.component.html index fd7e2ff..def13ca 100644 --- a/src/app/modules/admin/report/today-bet/components/list.component.html +++ b/src/app/modules/admin/report/today-bet/components/list.component.html @@ -1,355 +1,235 @@ -