diff --git a/src/routes/merchants/+page.svelte b/src/routes/merchants/+page.svelte index 4aa0abd..b0887f6 100644 --- a/src/routes/merchants/+page.svelte +++ b/src/routes/merchants/+page.svelte @@ -19,20 +19,25 @@ let value_merchantsFilter = "true"; let showMerchants = false; let value_sumMerchant = 0; + // let value_geoMerchants = "1"; - $: value_merchantsFilter, getMerchants(); + $: if (value_merchantsFilter.length > 0 || value_geoMerchants.length > 0) { + getMerchants(); + } async function getMerchants() { showMerchants = false; let res = await makePost( "admin/merchants", { + // id: Number(value_geoMerchants), active: value_merchantsFilter === "true", }, makeAuthHeaderForAxios(getAuthInfo()?.a), ); // console.log(res); - merchants = res.data; + merchants = res.data.data; + console.log(merchants); if (Array.isArray(merchants) === false) { merchants = []; } @@ -63,6 +68,7 @@ let showStats = false; let disablePayButton = false; let showPaySpin = false; + let merchantsGeos = []; async function getStatistics() { showStats = false; let res = await makePost( @@ -77,6 +83,12 @@ makeAuthHeaderForAxios(getAuthInfo()?.a), ); statsResult = res.data; + res = await makePost("admin/merchantsGeo", { + id: Number(selectedMerchant) + }, makeAuthHeaderForAxios(getAuthInfo()?.a)); + merchantsGeos = res.data.data; + console.log('geos', merchantsGeos); + showStats = true; } @@ -187,7 +199,18 @@

Мерчанты

-
+
+ +
+
+

Статус

{/if} {/if} -

Уменьшение баланса

+

Сеттлы