98 lines
5.2 KiB
PHP
98 lines
5.2 KiB
PHP
<!-- 道具列表-->
|
|
<?php
|
|
use common\services\ItemServices;
|
|
use common\utils\CommUtil;
|
|
use yii\helpers\Url;
|
|
use yii\widgets\LinkPager;
|
|
|
|
$userID=Yii::$app->request->get('user_id');
|
|
?>
|
|
|
|
<section class="content-header">
|
|
<!-- 查询-->
|
|
<div class="box box-primary">
|
|
<div class="box-body">
|
|
<form action="<?= Url::to() ?>" class="form-horizontal" method="get">
|
|
<div class="row">
|
|
<input name="r" type="text" hidden value="user/item-list">
|
|
<div class="col-xs-4">
|
|
<div class="form-group">
|
|
<label for="user_id" class="col-sm-3 control-label">玩家ID</label>
|
|
<div class="col-sm-9">
|
|
<input id="user_id" name="user_id" type="text" class="form-control" placeholder="玩家ID" value="<?=$userID?>">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary">查询</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<?php if(!empty($userID)):?>
|
|
<!-- Main content -->
|
|
<section class="content">
|
|
<div class="box">
|
|
<div class="box-header">
|
|
<h3 class="box-title">道具列表</h3>
|
|
</div>
|
|
<!-- /.box-header -->
|
|
<div class="box-body">
|
|
<div id="example2_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
|
<div class="row">
|
|
<div class="col-sm-6"></div>
|
|
<div class="col-sm-6"></div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<table id="example2" class="table table-bordered table-hover dataTable" role="grid" aria-describedby="example2_info">
|
|
<thead>
|
|
<tr role="row">
|
|
<th class="sorting_asc" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-sort="ascending"
|
|
aria-label="Rendering engine: activate to sort column descending">ID
|
|
</th>
|
|
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Browser: activate to sort column ascending">物品ID</th>
|
|
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Platform(s): activate to sort column ascending">名称</th>
|
|
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="Engine version: activate to sort column ascending">物品类型</th>
|
|
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending">数量</th>
|
|
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending">更新时间</th>
|
|
<th class="sorting" tabindex="0" aria-controls="example2" rowspan="1" colspan="1" aria-label="CSS grade: activate to sort column ascending"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<?php foreach ($list as $item): ?>
|
|
<tr role="row">
|
|
<td><?= $item['id'] ?></td>
|
|
<td><?= $item['item_id'] ?></td>
|
|
<td><?= $item['name'] ?></td>
|
|
<td><?= ItemServices::ITEM_TYPE_STR[$item['type']] ?></td>
|
|
<td><?= $item['num'] ?></td>
|
|
<td><?= CommUtil::formatDate($item['updated_at']) ?></td>
|
|
<td>
|
|
<a href="javascript:delConfirm('你确定要删除吗?', '<?= Url::to(['user/item-del','id'=>$item['id']])?>')"><i class="fa fa-remove"></i></a>
|
|
<a href="<?= Url::to(['user/item-get','id'=>$item['id']])?>"><i class="fa fa-edit"></i></a>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-5">
|
|
<div class="dataTables_info" id="example2_info" role="status" aria-live="polite"><?= sprintf('总共%d条数据',$totalCount); ?></div>
|
|
</div>
|
|
<div class="col-sm-7">
|
|
<div class="dataTables_paginate paging_simple_numbers" id="example2_paginate">
|
|
<?= LinkPager::widget(['pagination' => $pages]); ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- /.box-body -->
|
|
</div>
|
|
</section>
|
|
<?php endif; ?>
|