Bläddra i källkod

add 参数控制

Tree 2 månader sedan
förälder
incheckning
23b00e97a6

+ 37 - 0
app/Http/Controllers/Admin/ProtectController.php

@@ -0,0 +1,37 @@
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+use App\Facade\TableName;
+use Illuminate\Http\Request;
+use Illuminate\Support\Facades\DB;
+
+class ProtectController
+{
+    // 保护配置列表
+    public function protect_config_info()
+    {
+        $list = DB::connection('write')->table(TableName::QPPlatformDB() . 'ProtectConfigInfo')->get();
+
+        return view('admin.protect.protect_config_info', compact('list'));
+    }
+
+    // 保护配置修改
+    public function protect_config_info_update(Request $request, $ID)
+    {
+        if ($request->isMethod('post')) {
+            $post = $request->post();
+            $post = array_map(function ($val) {
+                return (int)$val;
+            }, $post);
+            
+            DB::connection('write')->table(TableName::QPPlatformDB() . 'ProtectConfigInfo')
+                ->where('ID', $ID)
+                ->update($post);
+            return apiReturnSuc();
+        } else {
+            $info = DB::connection('write')->table(TableName::QPPlatformDB() . 'ProtectConfigInfo')->where('ID', $ID)->first();
+            return view('admin.protect.protect_config_info_update', compact('info'));
+        }
+    }
+}

+ 7 - 0
resources/views/admin/control/control_config_info.blade.php

@@ -36,6 +36,9 @@
                                     <th >{{ __('auto.用户控制下限参数百分比') }}</th>
                                     <th >{{ __('auto.充值基准系数参数百分比') }}</th>
                                     <th >{{ __('auto.茶叶基准系数参数百分比') }}</th>
+                                    <th >{{ __('免费用户最多赢分') }}</th>
+                                    <th >{{ __('充值减值') }}</th>
+                                    <th >{{ __('非vip用户跳出新手期后的个控') }}</th>
                                    <th>{{ __('auto.是否生效') }}</th>
                                    <th>{{ __('auto.操作') }}</th>
                                 </tr>
@@ -56,6 +59,10 @@
                                         <td>{{ $v->UserControlLost }}</td>
                                         <td>{{ $v->PayCalPercent }}</td>
                                         <td>{{ $v->DrawCalPercent }}</td>
+                                        <td>{{ $v->FreeWinMaxGold }}</td>
+                                        <td>{{ $v->RechargeReduce }}</td>
+                                        <td>{{ $v->FreeUserValue }}</td>
+
                                         <td>
                                             @if ($v->Status == 1)
                                                 {{ __('auto.生效') }}

+ 19 - 0
resources/views/admin/control/control_config_info_update.blade.php

@@ -71,6 +71,25 @@
                                     <input type="text" class="form-control required" name="DrawCalPercent"
                                            placeholder="{{ __('auto.茶叶基准系数参数百分比') }}" value="{{ $info->DrawCalPercent }}">
                                 </div>
+
+                                <div class="form-group">
+                                    <h4>{{ __('auto.免费用户最多赢分') }}</h4>
+                                    <input type="text" class="form-control required" name="FreeWinMaxGold"
+                                           placeholder="{{ __('auto.免费用户最多赢分') }}" value="{{ $info->FreeWinMaxGold }}">
+                                </div>
+
+                                <div class="form-group">
+                                    <h4>{{ __('auto.充值减值') }}</h4>
+                                    <input type="text" class="form-control required" name="RechargeReduce"
+                                           placeholder="{{ __('auto.充值减值') }}" value="{{ $info->RechargeReduce }}">
+                                </div>
+
+                                <div class="form-group">
+                                    <h4>{{ __('auto.非vip用户跳出新手期后的个控') }}</h4>
+                                    <input type="text" class="form-control required" name="FreeUserValue"
+                                           placeholder="{{ __('auto.非vip用户跳出新手期后的个控') }}" value="{{ $info->FreeUserValue }}">
+                                </div>
+
                                 <div>
                                     <label for="Status">{{ __('auto.是否生效') }}</label>
                                     <input type="radio" id="Status" name="Status" value="1" @if ($info->Status == 1)

+ 88 - 0
resources/views/admin/protect/protect_config_info.blade.php

@@ -0,0 +1,88 @@
+@extends('base.base')
+@section('base')
+    <!-- 内容区域 -->
+    <div class="main-panel">
+        <div class="content-wrapper">
+            <div class="page-header">
+                <h3 class="page-title">
+                     <span class="page-title-icon bg-gradient-primary text-white mr-2">
+                        <i class="mdi mdi-shield-check"></i>
+                    </span>
+                    保护配置管理
+                </h3>
+                <nav aria-label="breadcrumb">
+                    <ol class="breadcrumb">
+                        <li class="breadcrumb-item"><a href="#">系统管理</a></li>
+                        <li class="breadcrumb-item active" aria-current="page">保护配置管理</li>
+                    </ol>
+                </nav>
+            </div>
+            <div class="row">
+                <div class="col-lg-12 grid-margin stretch-card">
+                    <div class="card">
+                        <div class="card-body">
+                            <h4 class="card-title">保护配置列表</h4>
+                            <table class="table table-bordered">
+                                <thead>
+                                <tr>
+                                    <th>ID</th>
+                                    <th>提充比小于(%)</th>
+                                    <th>流水/充值比例上限值</th>
+                                    <th>单笔充值金额/持有下限参数</th>
+                                    <th>大奖上限百分比</th>
+                                    <th>大奖下限百分比</th>
+                                    <th>充值基准系数参数百分比</th>
+                                    <th>最小充值</th>
+                                    <th>最大充值</th>
+                                    <th>充值金额计算方式</th>
+                                    <th>状态</th>
+                                    <th>操作</th>
+                                </tr>
+                                </thead>
+                                <tbody>
+                                @foreach($list as $k=>$v)
+                                    <tr>
+                                        <td>{{ $v->ID }}</td>
+                                        <td>{{ $v->TradeRateMax }}</td>
+                                        <td>{{ $v->TurnoverRechargeRatio }}</td>
+                                        <td>{{ $v->RechargeGoldRatio }}</td>
+                                        <td>{{ $v->RewardMaxPercent }}</td>
+                                        <td>{{ $v->RewardMinPercent }}</td>
+                                        <td>{{ $v->PayCalPercent }}</td>
+                                        <td>{{ $v->RechargeMin }}</td>
+                                        <td>{{ $v->RechargeMax }}</td>
+                                        <td>{{ $v->RechargeCalModel == 0 ? '单笔' : '平均值' }}</td>
+                                        <td>
+                                            @if ($v->Status == 1)
+                                                生效
+                                            @else
+                                                无效
+                                            @endif
+                                        </td>
+                                        <td>
+                                            <button class="btn btn-sm btn-gradient-dark" onclick="update({{$v->ID}})">修改</button>
+                                        </td>
+                                    </tr>
+                                @endforeach
+                                </tbody>
+                            </table>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <script>
+        function update(ID) {
+            var page = layer.open({
+                type: 2,
+                title: '修改保护配置',
+                shadeClose: true,
+                offset: 't',
+                shade: 0.8,
+                area: ['80%', '90%'],
+                content: '/admin/Protect/protect_config_info_update/'+ ID
+            });
+        }
+    </script>
+@endsection

+ 123 - 0
resources/views/admin/protect/protect_config_info_update.blade.php

@@ -0,0 +1,123 @@
+@extends('base.base')
+@section('base')
+    <!-- 内容区域 -->
+    <div class="main-panel">
+        <div class="content-wrapper">
+            <div class="row">
+                <div class="col-12 grid-margin stretch-card">
+                    <div class="card">
+                        <div class="card-body">
+                            <h4 class="card-title">修改保护配置</h4>
+
+                            <form class="forms-sample" id="form">
+
+                                <div class="form-group">
+                                    <h4>提充比小于(%)</h4>
+                                    <input type="number" class="form-control required" name="TradeRateMax"
+                                           placeholder="提充比小于(%)" value="{{ $info->TradeRateMax }}">
+                                </div>
+                                <div class="form-group">
+                                    <h4>流水/充值比例上限值参数</h4>
+                                    <input type="number" class="form-control required" name="TurnoverRechargeRatio"
+                                           placeholder="流水/充值比例上限值参数" value="{{ $info->TurnoverRechargeRatio }}">
+                                </div>
+                                <div class="form-group">
+                                    <h4>单笔充值金额/持有下限参数</h4>
+                                    <input type="number" class="form-control required" name="RechargeGoldRatio"
+                                           placeholder="单笔充值金额/持有下限参数" value="{{ $info->RechargeGoldRatio }}">
+                                </div>
+                                <div class="form-group">
+                                    <h4>大奖上限百分比</h4>
+                                    <input type="number" class="form-control required" name="RewardMaxPercent"
+                                           placeholder="大奖上限百分比" value="{{ $info->RewardMaxPercent }}">
+                                </div>
+                                <div class="form-group">
+                                    <h4>大奖下限百分比</h4>
+                                    <input type="number" class="form-control required" name="RewardMinPercent"
+                                           placeholder="大奖下限百分比" value="{{ $info->RewardMinPercent }}">
+                                </div>
+                                <div class="form-group">
+                                    <h4>充值基准系数参数百分比</h4>
+                                    <input type="number" class="form-control required" name="PayCalPercent"
+                                           placeholder="充值基准系数参数百分比" value="{{ $info->PayCalPercent }}">
+                                </div>
+                                <div class="form-group">
+                                    <h4>最小充值</h4>
+                                    <input type="number" class="form-control required" name="RechargeMin"
+                                           placeholder="最小充值" value="{{ $info->RechargeMin }}">
+                                </div>
+                                <div class="form-group">
+                                    <h4>最大充值</h4>
+                                    <input type="number" class="form-control required" name="RechargeMax"
+                                           placeholder="最大充值" value="{{ $info->RechargeMax }}">
+                                </div>
+                                <div class="form-group">
+                                    <h4>充值金额计算方式</h4>
+                                    <select class="form-control" name="RechargeCalModel">
+                                        <option value="0" @if($info->RechargeCalModel == 0) selected @endif>单笔</option>
+                                        <option value="1" @if($info->RechargeCalModel == 1) selected @endif>平均值</option>
+                                    </select>
+                                </div>
+
+                                <div class="form-group">
+                                    <label>是否生效</label>
+                                    <div class="form-check">
+                                        <input type="radio" class="form-check-input" name="Status" value="1" 
+                                               @if ($info->Status == 1) checked @endif>
+                                        <label class="form-check-label">生效</label>
+                                    </div>
+                                    <div class="form-check">
+                                        <input type="radio" class="form-check-input" name="Status" value="0" 
+                                               @if ($info->Status == 0) checked @endif>
+                                        <label class="form-check-label">无效</label>
+                                    </div>
+                                </div>
+
+                                <button type="button" onclick="commit({{ $info->ID }})"
+                                        class="btn btn-sm btn-gradient-primary btn-icon-text">
+                                    <i class="mdi mdi-file-check btn-icon-prepend"></i>
+                                    提交
+                                </button>
+                                <button type="button" onclick="cancel()"
+                                        class="btn btn-sm btn-gradient-warning btn-icon-text">
+                                    <i class="mdi mdi-reload btn-icon-prepend"></i>
+                                    取消
+                                </button>
+                            </form>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+    <script>
+
+        function commit(ID) {
+            if (!checkForm()) {
+                return false;
+            }
+
+            var data = $("#form").serializeObject();
+
+            for (var i in data) {
+                if (data[i] !== '' && parseInt(data[i]) < 0) {
+                    layer.msg('配置不能小于0');
+                    return false;
+                }
+            }
+            
+            myRequest("/admin/Protect/protect_config_info_update/"+ID, "post", data, function (res) {
+                layer.msg(res.msg);
+                if (res.code == '200') {
+                    setTimeout(function () {
+                        parent.location.reload();
+                    }, 1500);
+                }
+            });
+        }
+
+        function cancel() {
+            parent.layer.closeAll();
+        }
+    </script>
+@endsection

+ 4 - 0
routes/web.php

@@ -450,6 +450,10 @@ Route::group([
         $route->get('/Control/control_config_info', 'Admin\ControlController@control_config_info');
         $route->any('/Control/control_config_info_update/{id}', 'Admin\ControlController@control_config_info_update');
 
+        // 保护配置管理
+        $route->get('/Protect/protect_config_info', 'Admin\ProtectController@protect_config_info');
+        $route->any('/Protect/protect_config_info_update/{id}', 'Admin\ProtectController@protect_config_info_update');
+
 
         /* 系统设置  IP白名单管理*/
         // 列表