修改用户提现配置

This commit is contained in:
邹景立 2021-03-16 18:56:58 +08:00
parent 16b1994045
commit 08b269a99b
3 changed files with 115 additions and 41 deletions

View File

@ -3,7 +3,7 @@
namespace app\data\controller;
use app\data\service\UserService;
use app\data\service\UserUpgradeService;
use app\data\service\UserTransferService;
use think\admin\Controller;
use think\admin\extend\CodeExtend;
use think\admin\service\AdminService;
@ -21,14 +21,6 @@ class UserTransfer extends Controller
*/
private $table = 'DataUserTransfer';
protected $types = [
'wechat_user' => '转账到我的微信零钱',
'wechat_qrcode' => '线下转账微信收款码',
'alipay_qrcode' => '线下转账支付宝收款码',
'alipay_account' => '线下到账到支付宝账户',
'bank_offline' => '线下转账到银行卡账户',
];
/**
* 提现配置配置
* @throws \think\db\exception\DataNotFoundException
@ -39,6 +31,7 @@ class UserTransfer extends Controller
{
$this->skey = 'TransferRule';
$this->title = '提现规则配置';
$this->types = UserTransferService::instance()->types();
$this->_sysdata();
}

View File

@ -0,0 +1,44 @@
<?php
namespace app\data\service;
use think\admin\Service;
/**
* 用户转账服务
* Class UserTransferService
* @package app\data\service
*/
class UserTransferService extends Service
{
protected $types = [
'wechat_wallet' => '转账到我的微信零钱',
'wechat_qrcode' => '线下微信收款码转账',
'alipay_qrcode' => '线下支付宝收款码转账',
'alipay_account' => '线下转账到支付宝账户',
'transfer_banks' => '线下转账到银行卡账户',
];
/**
* 获取转账类型
* @return array
*/
public function types(): array
{
return $this->types;
}
/**
* 获取提现配置
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function config(): array
{
return sysdata('TransferRule');
}
}

View File

@ -1,10 +1,21 @@
<style xmlns="http://www.w3.org/1999/html">
.payment-type td .layui-form-checkbox {
margin: 0 !important;
padding-left: 25px !important;
}
.payment-type td .layui-form-switch {
margin: 0 !important;
}
</style>
<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
<div class="layui-card-body padding-left-40">
<div class="layui-form-item relative block">
<span class="color-green font-w7 label-required-prev">是否开启提现</span>
<span class="color-green font-w7 label-required-prev">用户提现状态</span>
<span class="color-desc margin-left-5">Transfer State</span>
<div class="layui-textarea padding-15" style="min-height:auto">
<div>
{php} $data['transfer_state'] = $data['transfer_state'] ?? 0; {/php}
{foreach ['关闭用户提现', '开启用户提现'] as $k => $v}
{if $data.transfer_state eq $k}
@ -15,41 +26,67 @@
</div>
</div>
<div class="layui-form-item relative block">
<span class="color-green font-w7 label-required-prev">提现金额范围</span>
<span class="color-desc margin-left-5">Transfer Amount Range</span>
<div class="padding-10">
<div class="layui-inline">
<label class="layui-input-inline" style="width:200px;">
<span class="font-s12 color-blue">最小提现金额( </span>
<input type="text" placeholder="" class="layui-input" data-blur-number="2" name="transfer_min" value="{$data.transfer_min|default='1.00'}">
</label>
<div class="layui-form-mid text-center notselect"><span class="block"> </span><span class="block">-</span></div>
<label class="layui-input-inline" style="width:200px;">
<span class="font-s12 color-blue">最大提现金额( </span>
<input type="text" placeholder="" class="layui-input" data-blur-number="2" name="transfer_max" value="{$data.transfer_max|default='2000.00'}">
</label>
</div>
</div>
</div>
<label class="layui-form-item relative block">
<span class="color-green font-w7 label-required-prev">提现手续费配置</span>
<span class="color-desc margin-left-5">Transfer Charge</span>
<input name="transfer_charge" class='layui-input' data-value-min="0.0000" data-value-max="50.0000" data-blur-number="4" value='{$data.transfer_charge|default="0.0000"}'>
<span class='help-block'>请输入提现金额的百分比,费率的取值范围为 0.0000% - 50.0000%</span>
</label>
<div class="layui-form-item relative block">
<span class="color-green font-w7 label-required-prev">提现是否需要审核</span>
<span class="color-desc margin-left-5">Transfer Record Audit</span>
<div class="layui-textarea padding-15" style="min-height:auto">
{php} $data['transfer_audit'] = $data['transfer_audit'] ?? 0; {/php}
{foreach ['提现无需审核', '提现需要审核'] as $k => $v}
{if $data.transfer_audit eq $k}
<input checked class="layui-input layui-bg-gray" type="radio" title="{$v}" name="transfer_audit" value="{$k}">
{else}
<input class="layui-input layui-bg-gray" type="radio" title="{$v}" name="transfer_audit" value="{$k}">
{/if}{/foreach}
</div>
<div class="layui-form-item">
<span class="color-green font-w7 label-required-prev">提现方式状态配置</span>
<span class="color-desc margin-left-5">Transfer Types</span>
<table class="layui-table payment-type" lay-skin="nob">
<thead>
<tr>
<th class="text-center notselect"><b>提现转账方式</b></th>
<td class="text-center notselect"><b>是否需要审核</b></td>
<td class="text-center notselect"><b>单笔最小提现金额( </b></td>
<td></td>
<td class="text-center notselect"><b>单笔最大提现金额( </b></td>
</tr>
</thead>
<tbody>
{foreach $types as $k => $t}
<tr class="think-bg-white">
<td class="nowrap">
{php} $key = 'transfer_'.$k.'_state'; {/php}
{if isset($data[$key]) and $data[$key] eq 1}
<input checked type="checkbox" name="{$key}" value="1" lay-skin="primary" title="{$t}">
{else}
<input type="checkbox" name="{$key}" value="1" lay-skin="primary" title="{$t}">
{/if}
</td>
<td class="text-center" style="width:80px">
{php} $key = 'transfer_'.$k.'_audit'; {/php}
{if isset($data[$key]) and $data[$key] eq 1}
<input checked type="checkbox" name="{$key}" value="1" lay-skin="switch" lay-text="需审核|免审核">
{else}
<input type="checkbox" name="{$key}" value="1" lay-skin="switch" lay-text="需审核|免审核">
{/if}
</td>
<td class="text-center">
<label>
{php} $key = 'transfer_'.$k.'_min'; {/php}
<input placeholder="" class="layui-input" data-blur-number="2" name="{$key}" value="{$data[$key] ?? '1.00'}">
</label>
</td>
<td class="text-center">-</td>
<td class="text-center">
<label>
{php} $key = 'transfer_'.$k.'_max'; {/php}
<input placeholder="" class="layui-input" data-blur-number="2" name="{$key}" value="{$data[$key] ?? '2000.00'}">
</label>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
<div class="layui-form-item relative block">
<span class="color-green font-w7">用户提现描述内容</span>
<span class="color-desc margin-left-5">Transfer Record Remark</span>
<span class="color-desc margin-left-5">Transfer Remark</span>
<label class="relative block">
<textarea class="layui-textarea" placeholder="请输入用户提现描述内容" name="remark">{$data.remark|default=''}</textarea>
</label>