add option page of score #21
This commit is contained in:
parent
48ebec183f
commit
7b0dc771ba
|
|
@ -24,6 +24,11 @@ class AdminController extends BaseController
|
|||
View::show('admin.customize');
|
||||
}
|
||||
|
||||
public function score()
|
||||
{
|
||||
View::show('admin.score');
|
||||
}
|
||||
|
||||
public function options()
|
||||
{
|
||||
View::show('admin.options');
|
||||
|
|
|
|||
|
|
@ -18,10 +18,11 @@ $menu['user'] = array(
|
|||
|
||||
$menu['admin'] = array(
|
||||
1 => ['title' => '仪表盘', 'link' => '/admin', 'icon' => 'fa-dashboard'],
|
||||
2 => ['title' => '用户管理', 'link' => '/admin/users', 'icon' => 'fa-users'],
|
||||
3 => ['title' => '角色管理', 'link' => '/admin/players', 'icon' => 'fa-gamepad'],
|
||||
2 => ['title' => '用户管理', 'link' => '/admin/users', 'icon' => 'fa-users'],
|
||||
3 => ['title' => '角色管理', 'link' => '/admin/players', 'icon' => 'fa-gamepad'],
|
||||
4 => ['title' => '个性化', 'link' => '/admin/customize', 'icon' => 'fa-paint-brush'],
|
||||
5 => ['title' => '站点配置', 'link' => '/admin/options', 'icon' => 'fa-cog']
|
||||
5 => ['title' => '积分配置', 'link' => '/admin/score', 'icon' => 'fa-credit-card'],
|
||||
6 => ['title' => '站点配置', 'link' => '/admin/options', 'icon' => 'fa-cog']
|
||||
);
|
||||
|
||||
return $menu;
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ Route::group(['middleware' => 'App\Middlewares\CheckAdminMiddl
|
|||
Route::get('/', 'AdminController@index');
|
||||
|
||||
Route::all('/customize', 'AdminController@customize');
|
||||
Route::all('/score', 'AdminController@score');
|
||||
Route::all('/options', 'AdminController@options');
|
||||
|
||||
Route::get('/users', 'AdminController@users');
|
||||
|
|
|
|||
|
|
@ -4,9 +4,7 @@
|
|||
|
||||
@section('style')
|
||||
<style type="text/css">
|
||||
.box-body > textarea {
|
||||
height: 200px;
|
||||
}
|
||||
.box-body > textarea { height: 200px; }
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
|
|
@ -89,15 +87,6 @@
|
|||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="key">新用户默认积分</td>
|
||||
<td class="value">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="user_initial_score" value="{{ Option::get('user_initial_score') }}">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="key">角色名</td>
|
||||
<td class="value">
|
||||
|
|
@ -125,17 +114,6 @@
|
|||
<textarea class="form-control" rows="4" name="comment_script">{{ Option::get('comment_script') }}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="key">签到间隔时间</td>
|
||||
<td class="value">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="sign_gap_time" value="{{ Option::get('sign_gap_time') }}">
|
||||
<span class="input-group-addon">小时</span>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!-- /.box-body -->
|
||||
|
|
|
|||
128
resources/views/admin/score.tpl
Normal file
128
resources/views/admin/score.tpl
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
@extends('admin.master')
|
||||
|
||||
@section('title', '积分配置')
|
||||
|
||||
@section('content')
|
||||
|
||||
<!-- Content Wrapper. Contains page content -->
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
积分配置
|
||||
<small>Score Options</small>
|
||||
</h1>
|
||||
</section>
|
||||
|
||||
<!-- Main content -->
|
||||
<section class="content">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">积分换算</h3>
|
||||
</div><!-- /.box-header -->
|
||||
<form method="post" action="../admin/score">
|
||||
<input type="hidden" name="option" value="rate">
|
||||
<div class="box-body">
|
||||
<?php
|
||||
if (isset($_POST['option']) && ($_POST['option'] == "rate")) {
|
||||
Option::set('score_per_storage', $_POST['score_per_storage']);
|
||||
Option::set('score_per_player', $_POST['score_per_player']);
|
||||
Option::set('user_initial_score', $_POST['user_initial_score']);
|
||||
echo '<div class="callout callout-success">设置已保存。</div>';
|
||||
} ?>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="key">存储</td>
|
||||
<td class="value">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="score_per_storage" value="{{ Option::get('score_per_storage') }}">
|
||||
<span class="input-group-addon">积分 = 1 KB</span>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="key">角色</td>
|
||||
<td class="value">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="score_per_player" value="{{ Option::get('score_per_player') }}">
|
||||
<span class="input-group-addon">积分 = 一个角色</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="key">新用户默认积分</td>
|
||||
<td class="value">
|
||||
<input type="text" class="form-control" name="user_initial_score" value="{{ Option::get('user_initial_score') }}">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!-- /.box-body -->
|
||||
<div class="box-footer">
|
||||
<button type="submit" name="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">签到配置</h3>
|
||||
</div><!-- /.box-header -->
|
||||
<form method="post" action="../admin/score">
|
||||
<input type="hidden" name="option" value="sign">
|
||||
<div class="box-body">
|
||||
<?php
|
||||
if (isset($_POST['option']) && ($_POST['option'] == "sign")) {
|
||||
$sign_score = $_POST['sign_score_from'].','.$_POST['sign_score_to'];
|
||||
Option::set('sign_score', $sign_score);
|
||||
Option::set('sign_gap_time', $_POST['sign_gap_time']);
|
||||
echo '<div class="callout callout-success">设置已保存。</div>';
|
||||
} ?>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="key">签到获得积分</td>
|
||||
<td class="value">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="sign_score_from" value="{{ explode(',', Option::get('sign_score'))[0] }}">
|
||||
<span class="input-group-addon" style="border-right: 0; border-left: 0;">积分 ~ </span>
|
||||
<input type="text" class="form-control" name="sign_score_to" value="{{ explode(',', Option::get('sign_score'))[1] }}">
|
||||
<span class="input-group-addon">积分</span>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="key">签到间隔时间</td>
|
||||
<td class="value">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="sign_gap_time" value="{{ Option::get('sign_gap_time') }}">
|
||||
<span class="input-group-addon">小时</span>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!-- /.box-body -->
|
||||
<div class="box-footer">
|
||||
<button type="submit" name="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section><!-- /.content -->
|
||||
</div><!-- /.content-wrapper -->
|
||||
|
||||
@endsection
|
||||
|
|
@ -105,17 +105,18 @@
|
|||
|
||||
<p>为了不出现用户一个劲上传材质导致存储空间爆满,我们决定启用积分系统。</p>
|
||||
<p>添加角色以及上传材质都会消耗积分,而删除已经添加的角色和已上传的材质时积分将会被返还。</p>
|
||||
<p>本站用户初始积分为 {{ \Option::get('user_initial_score') }},每日签到可以随机获得 10~100 积分</p>
|
||||
<?php $sign_score = explode(',', Option::get('sign_score')); ?>
|
||||
<p>本站用户初始积分为 {{ \Option::get('user_initial_score') }},每日签到可以随机获得 {{ $sign_score[0] }} ~ {{ $sign_score[1] }} 积分</p>
|
||||
<p>添加皮肤库里的材质到衣柜不消耗积分。</p>
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<p class="text-center">1 积分 = 1 KB 存储空间</p>
|
||||
<p class="text-center">{{ Option::get('score_per_storage') }} 积分 = 1 KB 存储空间</p>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<p class="text-center">100 积分 = 1 个角色</p>
|
||||
<p class="text-center">{{ Option::get('score_per_player') }} 积分 = 1 个角色</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user