migration
This commit is contained in:
parent
0ca3467716
commit
ddc729d815
@ -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 @@
|
||||
<h1 class="text-2xl font-semibold">Мерчанты</h1>
|
||||
</div>
|
||||
<div class="w-full flex flex-col bg-base-300 p-4 rounded-box">
|
||||
<div class="flex p-4">
|
||||
<div class="flex flex-col p-2">
|
||||
<!-- <p>Гео</p>
|
||||
<select
|
||||
bind:value={value_geoMerchants}
|
||||
class="select select-bordered w-full text-base"
|
||||
>
|
||||
<option selected value="1">Киргизстан</option>
|
||||
<option value="false">Неактивные</option>
|
||||
</select> -->
|
||||
</div>
|
||||
<div class="flex flex-col p-2">
|
||||
<p>Статус</p>
|
||||
<select
|
||||
bind:value={value_merchantsFilter}
|
||||
class="select select-bordered w-full text-base"
|
||||
@ -205,9 +228,9 @@
|
||||
<th>ID</th>
|
||||
<th>Интеграция</th>
|
||||
<th>Имя</th>
|
||||
<th>Баланс (USDT)</th>
|
||||
<!-- <th>Баланс (USDT)</th>
|
||||
<th>Комиссия</th>
|
||||
<th>Курс на выплаты</th>
|
||||
<th>Курс на выплаты</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -227,9 +250,9 @@
|
||||
<td class="font-semibold">{merch["id"]}</td>
|
||||
<td>{merch["integration_type"]}</td>
|
||||
<td>{merch["name"]}</td>
|
||||
<td>{merch["balance"]}</td>
|
||||
<!-- <td>{merch["balance"]}</td>
|
||||
<td>{merch["rate"]}%</td>
|
||||
<td>{merch["payout_rate"]}</td>
|
||||
<td>{merch["payout_rate"]}</td> -->
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
@ -241,7 +264,7 @@
|
||||
</div>
|
||||
<div class="flex gap-4">
|
||||
<div class="bg-accent rounded-[4px] w-[10px] h-full"></div>
|
||||
<h1 class="text-2xl font-semibold">Статистика по заявкам</h1>
|
||||
<h1 class="text-2xl font-semibold">Статистика</h1>
|
||||
</div>
|
||||
<div class="w-full flex flex-col bg-base-300 p-4 rounded-box">
|
||||
{#if selectedMerchant === ""}
|
||||
@ -250,7 +273,32 @@
|
||||
</p>
|
||||
{:else}
|
||||
<div class="flex flex-col p-2">
|
||||
<p>Показать статистику за период для ID: {selectedMerchant}</p>
|
||||
<table class="table">
|
||||
<!-- head -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Регион</th>
|
||||
<th>Статус</th>
|
||||
<th>Баланс</th>
|
||||
<th>Тип баланса</th>
|
||||
<th>Pay In</th>
|
||||
<th>Pay Out</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each merchantsGeos as merch}
|
||||
<tr>
|
||||
<td class="font-semibold">{merch["code"]}</td>
|
||||
<td>{merch["is_active"] === "t" ? "Активен":"Отключен"}</td>
|
||||
<td>{merch["balance"]} {merch["balance_type"] === "0" ? "USDT":merch["code"]}</td>
|
||||
<td>{merch["balance_type"] === "0" ? "crypto":"fiat"}</td>
|
||||
<td>{merch["payin"]}%</td>
|
||||
<td>{merch["payout"]}%</td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="mt-4">Показать статистику за период для ID: {selectedMerchant}</p>
|
||||
<div class="mt-3">
|
||||
C: <input
|
||||
bind:value={value_startTime}
|
||||
@ -277,7 +325,7 @@
|
||||
<span class="loading loading-spinner self-center mt-4"></span>
|
||||
{/if}
|
||||
{/if}
|
||||
<p class="mt-4">Уменьшение баланса</p>
|
||||
<!-- <p class="mt-4">Уменьшение баланса</p>
|
||||
<input
|
||||
bind:value={value_sumMerchant}
|
||||
type="number"
|
||||
@ -293,7 +341,7 @@
|
||||
{#if showPaySpin}
|
||||
<span class="loading loading-spinner self-center"></span>
|
||||
{/if}
|
||||
</button>
|
||||
</button> -->
|
||||
</div>
|
||||
<p class="text-xl font-bold mt-4">Сеттлы</p>
|
||||
<select
|
||||
|
Loading…
x
Reference in New Issue
Block a user