装备列表

This commit is contained in:
kulawawa 2025-04-24 18:13:33 +08:00
parent 9f2836208e
commit 91ed6fa4d7
3 changed files with 184 additions and 0 deletions

View File

@ -0,0 +1,54 @@
<?php
// +----------------------------------------------------------------------
// | 作者:修缘 联系QQ278896498 QQ群1054861244
// | 声明:未经作者许可,禁止倒卖等商业运营,违者必究
// | 另接php业务网站制作、代理后台、gm后台、支付对接等
// +----------------------------------------------------------------------
// | 创建时间: 2022/1/1 2:54
// +----------------------------------------------------------------------
namespace app\admin\controller;
use app\common\model\Equip;
use think\Db;
use think\db\Connection;
use think\facade\Config;
use think\Request;
class EquipController extends Controller
{
protected function initialize(): void
{
parent::initialize(); // TODO: Change the autogenerated stub
$this->get_son_agency_account();
}
public function index(Equip $model, Request $request)
{
$param = $request->param();
// $son_agency_invite = $this->son_agency_invite . ",{$this->user->invite}";
$model = $model
->field('EquipID,EquipType,RoleID,Grade,create_time,name,BaseScore,pos')
->order('RoleID');
// ->withJoin([
//// 'account' => function ($query) use($son_agency_invite) {
//// $query->whereIn('invite', $son_agency_invite);
//// }
// ])->scope('where', $param);
$data = $model->paginate($this->admin['per_page'], false, ['query' => $request->get()]);
// dump($data);
$this->assign($request->get());
$this->assign([
'data' => $data->toArray()['data'],
'page' => $data->render(),
'total' => $data->total(),
]);
return $this->fetch();
}
}

View File

@ -0,0 +1,112 @@
{extend name="public/base" /}
{block name='content'}
{include file='public/content_header' /}
<!--数据列表页面-->
<section class="content">
<!--顶部搜索筛选-->
<div class="row">
<div class="col-md-12">
<div class="box">
<div class="box-body">
<form class="form-inline searchForm" id="searchForm" action="{:url('index')}" method="GET">
<div class="form-group">
<input {if(!empty($_keywords))} value="{$_keywords|trim=\0}" {else /} value='' {/if}
name="_keywords" id="_keywords" class="form-control"
placeholder="ID/角色名">
</div>
<div class="form-group">
<button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
</button>
</div>
<div class="form-group">
<button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
class="fa fa-eraser"></i> 清空查询
</button>
</div>
</form>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="box">
<!--数据列表顶部-->
<div class="box-header">
<div>
<a class="btn btn-success btn-sm ReloadButton" data-toggle="tooltip" title="刷新">
<i class="fa fa-refresh"></i> 刷新
</a>
</div>
</div>
<div class="box-body table-responsive">
<table class="table table-hover table-bordered datatable" width="100%">
<thead>
<tr>
<th>装备ID</th>
<th>装备类型</th>
<th>角色</th>
<th>装备等级</th>
<th>创建时间</th>
<th>装备名称</th>
<th>评分</th>
<th>装备位置</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{foreach name='data' id='item' key='data_key'}
<tr>
<td>{$item.EquipID}</td>
<td>{$item.EquipType}</td>
<td>{$item.RoleID}</td>
<td>{$item.Grade}</td>
<td>{$item.create_time}</td>
<td>{$item.name}</td>
<td>{$item.BaseScore}</td>
<td>{$item.pos}</td>
<td class="td-do">
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
<!-- 数据列表底部 -->
<div class="box-footer">
{$page|raw}
<label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">
<small>{$total}条记录</small>&nbsp;
<small>每页显示</small>
&nbsp;
<select class="input-sm" onchange="changePerPage(this)">
<option value="10" {if $admin.per_page==10}selected{/if}>10</option>
<option value="20" {if $admin.per_page==20}selected{/if}>20</option>
<option value="30" {if $admin.per_page==30}selected{/if}>30</option>
<option value="50" {if $admin.per_page==50}selected{/if}>50</option>
<option value="100" {if $admin.per_page==100}selected{/if}>100</option>
</select>
&nbsp;
<small>条记录</small>
</label>
</div>
</div>
</div>
</div>
</section>
{/block}

View File

@ -0,0 +1,18 @@
<?php
// +----------------------------------------------------------------------
// | 作者:修缘 联系QQ278896498 QQ群1054861244
// | 声明:未经作者许可,禁止倒卖等商业运营,违者必究
// | 另接php业务网站制作、代理后台、gm后台、支付对接等
// +----------------------------------------------------------------------
// | 创建时间: 2022/1/19 19:31
// +----------------------------------------------------------------------
namespace app\common\model;
class Equip extends Model
{
protected $table = 'qy_equip';
}