You've already forked guangan
积分变化
This commit is contained in:
20
plugs/think-plugs-points-mall/src/controller/PointLog.php
Normal file
20
plugs/think-plugs-points-mall/src/controller/PointLog.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace plugin\points_mall\controller;
|
||||
|
||||
use plugin\points_mall\model\PointsMallUserPointLog;
|
||||
use think\admin\Controller;
|
||||
use think\admin\helper\QueryHelper;
|
||||
|
||||
class PointLog extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$this->title = '积分记录';
|
||||
PointsMallUserPointLog::mQuery()->layTable(function () {
|
||||
}, static function (QueryHelper $query) {
|
||||
$query->with('user');
|
||||
$query->dateBetween('create_at');
|
||||
});
|
||||
}
|
||||
}
|
@ -2,9 +2,15 @@
|
||||
|
||||
namespace plugin\points_mall\model;
|
||||
|
||||
use plugin\account\model\PluginAccountBind;
|
||||
use think\admin\Model;
|
||||
|
||||
class PointsMallUserPointLog extends Model
|
||||
{
|
||||
protected $pk = 'uid';
|
||||
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(PluginAccountBind::class, 'uid');
|
||||
}
|
||||
}
|
@ -1,13 +1,6 @@
|
||||
<fieldset>
|
||||
<legend>条件搜索</legend>
|
||||
<form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
|
||||
<div class="layui-form-item layui-inline">
|
||||
<label class="layui-form-label">积分范围</label>
|
||||
<div class="layui-input-inline">
|
||||
<input name="point_min" value="{:input('get.point_min')}" placeholder="最小积分" class="layui-input">
|
||||
<input name="point_max" value="{:input('get.point_max')}" placeholder="最大积分" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item layui-inline">
|
||||
<button class="layui-btn layui-btn-primary" lay-submit lay-filter="searchData"><i class="layui-icon"></i> 搜 索</button>
|
||||
|
51
plugs/think-plugs-points-mall/src/view/point_log/index.html
Normal file
51
plugs/think-plugs-points-mall/src/view/point_log/index.html
Normal file
@ -0,0 +1,51 @@
|
||||
{extend name="table"}
|
||||
|
||||
{block name="button"}
|
||||
{/block}
|
||||
|
||||
{block name="content"}
|
||||
<div class="layui-tab">
|
||||
<div class="layui-row">
|
||||
<div class="layui-col">
|
||||
<div class="point_list think-bg-white">
|
||||
{include file='point_log/index_search'}
|
||||
<table class="layui-hide" data-url="{$request->url()}" data-target-search="form.form-search" id="Table" lay-filter="Table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/html" id="toolbar">
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
{block name='style'}
|
||||
<style>
|
||||
</style>
|
||||
{/block}
|
||||
|
||||
{block name='script'}
|
||||
<script>
|
||||
$(function () {
|
||||
$('#Table').layTable({
|
||||
height: 'full-250',
|
||||
toolbar: true,
|
||||
sort: {field: 'create_at', type: 'desc'},
|
||||
title: '用户积分',
|
||||
cols: [[
|
||||
{field: 'uid', title: '用户ID', width: 100, sort: true},
|
||||
{field:'nickname', title:'用户昵称', width:120, templet:function(item){
|
||||
if (item.user) {
|
||||
return item.user.nickname || item.user.extra.nickName;
|
||||
} else {
|
||||
return '未知';
|
||||
}
|
||||
}},
|
||||
{field:'point', title:'积分变化', width:120, sort: true},
|
||||
{field:'reason', title:'备注', minWidth:120},
|
||||
{field:'create_at', title:'发生时间', width:160, sort: true},
|
||||
]]
|
||||
})
|
||||
})
|
||||
</script>
|
||||
{/block}
|
@ -0,0 +1,10 @@
|
||||
<fieldset>
|
||||
<legend>条件搜索</legend>
|
||||
<form class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get" autocomplete="off">
|
||||
|
||||
<div class="layui-form-item layui-inline">
|
||||
<button class="layui-btn layui-btn-primary" lay-submit lay-filter="searchData"><i class="layui-icon"></i> 搜 索</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</fieldset>
|
Reference in New Issue
Block a user