migration
This commit is contained in:
parent
0ca3467716
commit
ddc729d815
@ -19,20 +19,25 @@
|
|||||||
let value_merchantsFilter = "true";
|
let value_merchantsFilter = "true";
|
||||||
let showMerchants = false;
|
let showMerchants = false;
|
||||||
let value_sumMerchant = 0;
|
let value_sumMerchant = 0;
|
||||||
|
// let value_geoMerchants = "1";
|
||||||
|
|
||||||
$: value_merchantsFilter, getMerchants();
|
$: if (value_merchantsFilter.length > 0 || value_geoMerchants.length > 0) {
|
||||||
|
getMerchants();
|
||||||
|
}
|
||||||
|
|
||||||
async function getMerchants() {
|
async function getMerchants() {
|
||||||
showMerchants = false;
|
showMerchants = false;
|
||||||
let res = await makePost(
|
let res = await makePost(
|
||||||
"admin/merchants",
|
"admin/merchants",
|
||||||
{
|
{
|
||||||
|
// id: Number(value_geoMerchants),
|
||||||
active: value_merchantsFilter === "true",
|
active: value_merchantsFilter === "true",
|
||||||
},
|
},
|
||||||
makeAuthHeaderForAxios(getAuthInfo()?.a),
|
makeAuthHeaderForAxios(getAuthInfo()?.a),
|
||||||
);
|
);
|
||||||
// console.log(res);
|
// console.log(res);
|
||||||
merchants = res.data;
|
merchants = res.data.data;
|
||||||
|
console.log(merchants);
|
||||||
if (Array.isArray(merchants) === false) {
|
if (Array.isArray(merchants) === false) {
|
||||||
merchants = [];
|
merchants = [];
|
||||||
}
|
}
|
||||||
@ -63,6 +68,7 @@
|
|||||||
let showStats = false;
|
let showStats = false;
|
||||||
let disablePayButton = false;
|
let disablePayButton = false;
|
||||||
let showPaySpin = false;
|
let showPaySpin = false;
|
||||||
|
let merchantsGeos = [];
|
||||||
async function getStatistics() {
|
async function getStatistics() {
|
||||||
showStats = false;
|
showStats = false;
|
||||||
let res = await makePost(
|
let res = await makePost(
|
||||||
@ -77,6 +83,12 @@
|
|||||||
makeAuthHeaderForAxios(getAuthInfo()?.a),
|
makeAuthHeaderForAxios(getAuthInfo()?.a),
|
||||||
);
|
);
|
||||||
statsResult = res.data;
|
statsResult = res.data;
|
||||||
|
res = await makePost("admin/merchantsGeo", {
|
||||||
|
id: Number(selectedMerchant)
|
||||||
|
}, makeAuthHeaderForAxios(getAuthInfo()?.a));
|
||||||
|
merchantsGeos = res.data.data;
|
||||||
|
console.log('geos', merchantsGeos);
|
||||||
|
|
||||||
showStats = true;
|
showStats = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,7 +199,18 @@
|
|||||||
<h1 class="text-2xl font-semibold">Мерчанты</h1>
|
<h1 class="text-2xl font-semibold">Мерчанты</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full flex flex-col bg-base-300 p-4 rounded-box">
|
<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
|
<select
|
||||||
bind:value={value_merchantsFilter}
|
bind:value={value_merchantsFilter}
|
||||||
class="select select-bordered w-full text-base"
|
class="select select-bordered w-full text-base"
|
||||||
@ -205,9 +228,9 @@
|
|||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>Интеграция</th>
|
<th>Интеграция</th>
|
||||||
<th>Имя</th>
|
<th>Имя</th>
|
||||||
<th>Баланс (USDT)</th>
|
<!-- <th>Баланс (USDT)</th>
|
||||||
<th>Комиссия</th>
|
<th>Комиссия</th>
|
||||||
<th>Курс на выплаты</th>
|
<th>Курс на выплаты</th> -->
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -227,9 +250,9 @@
|
|||||||
<td class="font-semibold">{merch["id"]}</td>
|
<td class="font-semibold">{merch["id"]}</td>
|
||||||
<td>{merch["integration_type"]}</td>
|
<td>{merch["integration_type"]}</td>
|
||||||
<td>{merch["name"]}</td>
|
<td>{merch["name"]}</td>
|
||||||
<td>{merch["balance"]}</td>
|
<!-- <td>{merch["balance"]}</td>
|
||||||
<td>{merch["rate"]}%</td>
|
<td>{merch["rate"]}%</td>
|
||||||
<td>{merch["payout_rate"]}</td>
|
<td>{merch["payout_rate"]}</td> -->
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -241,7 +264,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex gap-4">
|
<div class="flex gap-4">
|
||||||
<div class="bg-accent rounded-[4px] w-[10px] h-full"></div>
|
<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>
|
||||||
<div class="w-full flex flex-col bg-base-300 p-4 rounded-box">
|
<div class="w-full flex flex-col bg-base-300 p-4 rounded-box">
|
||||||
{#if selectedMerchant === ""}
|
{#if selectedMerchant === ""}
|
||||||
@ -250,7 +273,32 @@
|
|||||||
</p>
|
</p>
|
||||||
{:else}
|
{:else}
|
||||||
<div class="flex flex-col p-2">
|
<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">
|
<div class="mt-3">
|
||||||
C: <input
|
C: <input
|
||||||
bind:value={value_startTime}
|
bind:value={value_startTime}
|
||||||
@ -277,7 +325,7 @@
|
|||||||
<span class="loading loading-spinner self-center mt-4"></span>
|
<span class="loading loading-spinner self-center mt-4"></span>
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
<p class="mt-4">Уменьшение баланса</p>
|
<!-- <p class="mt-4">Уменьшение баланса</p>
|
||||||
<input
|
<input
|
||||||
bind:value={value_sumMerchant}
|
bind:value={value_sumMerchant}
|
||||||
type="number"
|
type="number"
|
||||||
@ -293,7 +341,7 @@
|
|||||||
{#if showPaySpin}
|
{#if showPaySpin}
|
||||||
<span class="loading loading-spinner self-center"></span>
|
<span class="loading loading-spinner self-center"></span>
|
||||||
{/if}
|
{/if}
|
||||||
</button>
|
</button> -->
|
||||||
</div>
|
</div>
|
||||||
<p class="text-xl font-bold mt-4">Сеттлы</p>
|
<p class="text-xl font-bold mt-4">Сеттлы</p>
|
||||||
<select
|
<select
|
||||||
|
Loading…
x
Reference in New Issue
Block a user