diff --git a/src/app/mock-api/apps/report/statistics/api.ts b/src/app/mock-api/apps/report/statistics/api.ts index 69b7bee..8c50544 100644 --- a/src/app/mock-api/apps/report/statistics/api.ts +++ b/src/app/mock-api/apps/report/statistics/api.ts @@ -1,13 +1,13 @@ import { Injectable } from '@angular/core'; import { assign, cloneDeep } from 'lodash-es'; import { FuseMockApiService, FuseMockApiUtils } from '@fuse/lib/mock-api'; -import { statisticss as statisticssData } from './data'; +import { statistics as statisticsData } from './data'; @Injectable({ providedIn: 'root', }) export class ReportStatisticsMockApi { - private _statisticss: any[] = statisticssData; + private _statistics: any[] = statisticsData; /** * Constructor @@ -26,10 +26,10 @@ export class ReportStatisticsMockApi { */ registerHandlers(): void { // ----------------------------------------------------------------------------------------------------- - // @ Statisticss - GET + // @ Statistics - GET // ----------------------------------------------------------------------------------------------------- this._fuseMockApiService - .onGet('api/apps/report/statistics/statisticss', 300) + .onGet('api/apps/report/statistics/statistics', 300) .reply(({ request }) => { // Get available queries const search = request.params.get('search'); @@ -38,12 +38,12 @@ export class ReportStatisticsMockApi { const page = parseInt(request.params.get('page') ?? '1', 10); const size = parseInt(request.params.get('size') ?? '10', 10); - // Clone the statisticss - let statisticss: any[] | null = cloneDeep(this._statisticss); + // Clone the statistics + let statistics: any[] | null = cloneDeep(this._statistics); - // Sort the statisticss + // Sort the statistics if (sort === 'sku' || sort === 'name' || sort === 'active') { - statisticss.sort((a, b) => { + statistics.sort((a, b) => { const fieldA = a[sort].toString().toUpperCase(); const fieldB = b[sort].toString().toUpperCase(); return order === 'asc' @@ -51,15 +51,15 @@ export class ReportStatisticsMockApi { : fieldB.localeCompare(fieldA); }); } else { - statisticss.sort((a, b) => + statistics.sort((a, b) => order === 'asc' ? a[sort] - b[sort] : b[sort] - a[sort] ); } // If search exists... if (search) { - // Filter the statisticss - statisticss = statisticss.filter( + // Filter the statistics + statistics = statistics.filter( (contact: any) => contact.name && contact.name.toLowerCase().includes(search.toLowerCase()) @@ -67,32 +67,32 @@ export class ReportStatisticsMockApi { } // Paginate - Start - const statisticssLength = statisticss.length; + const statisticsLength = statistics.length; // Calculate pagination details const begin = page * size; - const end = Math.min(size * (page + 1), statisticssLength); - const lastPage = Math.max(Math.ceil(statisticssLength / size), 1); + const end = Math.min(size * (page + 1), statisticsLength); + const lastPage = Math.max(Math.ceil(statisticsLength / size), 1); // Prepare the pagination object let pagination = {}; // If the requested page number is bigger than // the last possible page number, return null for - // statisticss but also send the last possible page so + // statistics but also send the last possible page so // the app can navigate to there if (page > lastPage) { - statisticss = null; + statistics = null; pagination = { lastPage, }; } else { // Paginate the results by size - statisticss = statisticss.slice(begin, end); + statistics = statistics.slice(begin, end); // Prepare the pagination mock-api pagination = { - length: statisticssLength, + length: statisticsLength, size: size, page: page, lastPage: lastPage, @@ -105,7 +105,7 @@ export class ReportStatisticsMockApi { return [ 200, { - statisticss, + statistics, pagination, }, ]; @@ -120,11 +120,11 @@ export class ReportStatisticsMockApi { // Get the id from the params const id = request.params.get('id'); - // Clone the statisticss - const statisticss = cloneDeep(this._statisticss); + // Clone the statistics + const statistics = cloneDeep(this._statistics); // Find the statistics - const statistics = statisticss.find((item: any) => item.id === id); + const statistic = statistics.find((item: any) => item.id === id); // Return the response return [200, statistics]; @@ -160,7 +160,7 @@ export class ReportStatisticsMockApi { }; // Unshift the new statistics - this._statisticss.unshift(newStatistics); + this._statistics.unshift(newStatistics); // Return the response return [200, newStatistics]; @@ -180,13 +180,13 @@ export class ReportStatisticsMockApi { let updatedStatistics = null; // Find the statistics and update it - this._statisticss.forEach((item, index, statisticss) => { + this._statistics.forEach((item, index, statistics) => { if (item.id === id) { // Update the statistics - statisticss[index] = assign({}, statisticss[index], statistics); + statistics[index] = assign({}, statistics[index], statistics); // Store the updated Statistics - updatedStatistics = statisticss[index]; + updatedStatistics = statistics[index]; } }); @@ -204,9 +204,9 @@ export class ReportStatisticsMockApi { const id = request.params.get('id'); // Find the statistics and delete it - this._statisticss.forEach((item, index) => { + this._statistics.forEach((item, index) => { if (item.id === id) { - this._statisticss.splice(index, 1); + this._statistics.splice(index, 1); } }); diff --git a/src/app/mock-api/apps/report/statistics/data.ts b/src/app/mock-api/apps/report/statistics/data.ts index 96ccddf..ab7f328 100644 --- a/src/app/mock-api/apps/report/statistics/data.ts +++ b/src/app/mock-api/apps/report/statistics/data.ts @@ -2,32 +2,35 @@ export const statisticss = [ { - 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: '', + id: '7eb7c859-1347-4317-96b6-9476a7e2ba3c', + casinoUse: 2, + casinoBetting: 1183000, + casinoCancel: 10000, + casinoAvailable: 1140000, + casinoWinning: 979050, + casinoWinLoss: 193950, + casinoCommission: 14810, + casinoBetWinCalculate: 179140, + slotUse: 2, + slotBetting: 225000, + slotCancel: 0, + slotAvailable: 225000, + slotWinning: 114280, + slotWinLoss: 110720, + slotTotalCommission: 11250, + slotBetWinCalculate: 99470, + powerballUse: 0, + powerballBetting: 0, + powerballWinning: 0, + powerballWinLoss: 0, + powerballCommission: 0, + powerballBetWinCalculate: 0, + totalUse: 4, + totalAvailable: 1365000, + totalBetting: 1408000, + totalCancel: 10000, + totalWinLoss: 304670, + totalCommission: 26060, + totalBetWinCalculate: 278610, }, ]; diff --git a/src/app/modules/admin/report/statistics/components/list.component.html b/src/app/modules/admin/report/statistics/components/list.component.html index 99d131b..c61ef9e 100644 --- a/src/app/modules/admin/report/statistics/components/list.component.html +++ b/src/app/modules/admin/report/statistics/components/list.component.html @@ -13,135 +13,66 @@
종목별매출통계
- - - - - - - 40 - 60 - 80 - 100 - - - - - LV.1 - LV.2 - LV.3 - LV.4 - - - - - 정상 - 대기 - 탈퇴 - 휴면 - 블랙 - 정지 - - - - - 카지노제한 - 슬롯제한 - - - - - 계좌입금 - - - - - 카지노콤프 - 슬롯콤프 - 배팅콤프 - 첫충콤프 - - - - - - - + +
+ + +
+ +
+ - - +
+ +
+ + + + + +
+ +
+ + + + +
@@ -151,182 +82,100 @@
- - + +
- - - - - - - - +
요율
+ +
- +
- diff --git a/src/app/modules/admin/report/statistics/components/list.component.ts b/src/app/modules/admin/report/statistics/components/list.component.ts index 73af6f2..dac93d0 100644 --- a/src/app/modules/admin/report/statistics/components/list.component.ts +++ b/src/app/modules/admin/report/statistics/components/list.component.ts @@ -69,6 +69,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { statisticss$!: Observable; users$!: Observable; + __isSearchOpened = false; isLoading = false; searchInputControl = new FormControl(); selectedStatistics?: Statistics; @@ -117,7 +118,7 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { if (this._sort && this._paginator) { // Set the initial sort this._sort.sort({ - id: 'name', + id: 'casinoUse', start: 'asc', disableClear: true, }); @@ -186,6 +187,14 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { */ __toggleDetails(productId: string): void {} + /** + * toggle the search + * Used in 'bar' + */ + __onClickSearch(): void { + this.__isSearchOpened = !this.__isSearchOpened; + } + /** * Track by function for ngFor loops * diff --git a/src/app/modules/admin/report/statistics/models/statistics.ts b/src/app/modules/admin/report/statistics/models/statistics.ts index a3219a9..1d95e1e 100644 --- a/src/app/modules/admin/report/statistics/models/statistics.ts +++ b/src/app/modules/admin/report/statistics/models/statistics.ts @@ -1,29 +1,32 @@ export interface Statistics { - id?: string; - totalPartnerCount?: number; - totalHoldingMoney?: number; - totalComp?: number; - total?: number; - branchCount?: number; - divisionCount?: number; - officeCount?: number; - storeCount?: number; - memberCount?: number; - nickname?: string; - accountHolder?: string; - phoneNumber?: string; - calculateType?: string; - ownCash?: number; - ownComp?: number; - ownCoupon?: number; - gameMoney?: number; - todayComp?: number; - totalDeposit?: number; - totalWithdraw?: number; - balance?: number; - registDate?: string; - finalSigninDate?: string; - ip?: string; - state?: string; - note?: string; + id: string; + casinoUse?: number; + slotUse?: number; + powerballUse?: number; + casinoBetting?: number; // 카지노배팅 + casinoCancel?: number; // 카지노취소 + casinoAvailable?: number; // 카지노유효 + casinoWinning?: number; // 카지노당첨 + casinoWinLoss?: number; // 카지노윈로스(A) + casinoCommission?: number; // 카지노수수료(B) + casinoBetWinCalculate?: number; // 카지노벳윈정산 (A-B) + slotBetting?: number; // 슬롯배팅 + slotCancel?: number; // 슬롯취소 + slotAvailable?: number; // 슬롯유효 + slotWinning?: number; // 슬롯당첨 + slotWinLoss?: number; // 슬롯윈로스(D) + slotTotalCommission?: number; // 슬롯전체수수료(E) + slotBetWinCalculate?: number; // 슬롯벳윈정산(D-E) + powerballBetting?: number; // 파워볼배팅 + powerballWinning?: number; // 파워볼당첨 + powerballWinLoss?: number; // 파워볼윈로스(H) + powerballCommission?: number; // 파워볼수수료(I) + powerballBetWinCalculate?: number; // 파워볼벳윈정산(H-I) + totalUse?: number; // 총이용회원 + totalAvailable?: number; // 총유효배팅 + totalBetting?: number; // 총배팅 + totalCancel?: number; // 총취소 + totalWinLoss?: number; // 총윈로스 + totalCommission?: number; // 총수수료 + totalBetWinCalculate?: number; // 총벳윈정산 } diff --git a/src/app/modules/admin/report/statistics/statistics.module.ts b/src/app/modules/admin/report/statistics/statistics.module.ts index 737a47c..8222b33 100644 --- a/src/app/modules/admin/report/statistics/statistics.module.ts +++ b/src/app/modules/admin/report/statistics/statistics.module.ts @@ -12,9 +12,7 @@ import { MatSortModule } from '@angular/material/sort'; import { MatSelectModule } from '@angular/material/select'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatGridListModule } from '@angular/material/grid-list'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatDatepickerModule } from '@angular/material/datepicker'; import { TranslocoModule } from '@ngneat/transloco'; @@ -42,9 +40,7 @@ import { statisticsRoutes } from './statistics.routing'; MatSelectModule, MatTooltipModule, MatGridListModule, - MatSlideToggleModule, - MatRadioModule, - MatCheckboxModule, + MatDatepickerModule, ], }) export class StatisticsModule {}