setter
parent
ef39ca8a3f
commit
c1f57d709c
|
@ -123,4 +123,50 @@ class Consumer extends Base
|
||||||
return $this->view();
|
return $this->view();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 黑名单列表
|
||||||
|
*
|
||||||
|
* @return Json|View
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function blankList()
|
||||||
|
{
|
||||||
|
$stateArray = Account::allState();
|
||||||
|
if ($this->request->isPost()) {
|
||||||
|
$repo = AccountRepository::getInstance();
|
||||||
|
$keyword = $this->request->param('keyword/s', '');
|
||||||
|
$state = $this->request->param('state/d', "-1");
|
||||||
|
$page = $this->request->param('page/d', 1);
|
||||||
|
$size = $this->request->param('size/d', 30);
|
||||||
|
|
||||||
|
$whereMap = [
|
||||||
|
["type", "=", Account::type_consumer],
|
||||||
|
["blank_total", ">", 0],
|
||||||
|
];
|
||||||
|
$orders = ['id' => 'desc'];
|
||||||
|
if (!empty($keyword)) {
|
||||||
|
$whereMap[] = ['nick_name', 'like', "%$keyword%"];
|
||||||
|
}
|
||||||
|
if (isset($stateArray[$state])) {
|
||||||
|
$whereMap[] = ['state', '=', $state];
|
||||||
|
}
|
||||||
|
$list = $repo->findList($whereMap, [], $page, $size, function ($q) {
|
||||||
|
return $q->with("tag");
|
||||||
|
}, $orders);
|
||||||
|
$list["list"]->each(function ($item) {
|
||||||
|
//优惠券领取总数
|
||||||
|
$item->coupon_total_count = Coupon::where(["consumer_code" => $item->user_code])->count("id");
|
||||||
|
//优惠券使用总数
|
||||||
|
$item->coupon_used_count = Coupon::where(["consumer_code" => $item->user_code])->where("is_verificated", Coupon::is_verificated_on)->count("id");
|
||||||
|
//优惠券未使用总数
|
||||||
|
$item->coupon_not_use_count = Coupon::where(["consumer_code" => $item->user_code])->where("is_verificated", Coupon::is_verificated_off)->count("id");
|
||||||
|
});
|
||||||
|
|
||||||
|
return $this->json(0, 'success', $list);
|
||||||
|
|
||||||
|
}
|
||||||
|
$this->data["state"] = $stateArray;
|
||||||
|
return $this->view();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -22,13 +22,13 @@ return [
|
||||||
// 数据库类型
|
// 数据库类型
|
||||||
'type' => Env::get('database.type', 'mysql'),
|
'type' => Env::get('database.type', 'mysql'),
|
||||||
// 服务器地址
|
// 服务器地址
|
||||||
'hostname' => Env::get('database.hostname', '127.0.0.1'),
|
'hostname' => Env::get('database.hostname', '211.149.245.223'),
|
||||||
// 数据库名
|
// 数据库名
|
||||||
'database' => Env::get('database.database', 'coupon'),
|
'database' => Env::get('database.database', 'coupon'),
|
||||||
// 用户名
|
// 用户名
|
||||||
'username' => Env::get('database.username', 'root'),
|
'username' => Env::get('database.username', 'coupon'),
|
||||||
// 密码
|
// 密码
|
||||||
'password' => Env::get('database.password', 'root'),
|
'password' => Env::get('database.password', 'ReykreFGihazxPnj'),
|
||||||
// 端口
|
// 端口
|
||||||
'hostport' => Env::get('database.hostport', '3306'),
|
'hostport' => Env::get('database.hostport', '3306'),
|
||||||
// 数据库连接参数
|
// 数据库连接参数
|
||||||
|
|
|
@ -16,11 +16,7 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect'], function
|
||||||
let insTb = table.render({
|
let insTb = table.render({
|
||||||
elem: '#table-container',
|
elem: '#table-container',
|
||||||
toolbar: '#toolbar-tpl',
|
toolbar: '#toolbar-tpl',
|
||||||
defaultToolbar: [{ //自定义头部工具栏右侧图标。如无需自定义,去除该参数即可
|
defaultToolbar: null,
|
||||||
title: '搜索'
|
|
||||||
, layEvent: 'search'
|
|
||||||
, icon: 'layui-icon-search'
|
|
||||||
}],
|
|
||||||
url: listUrl,
|
url: listUrl,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
even: true,
|
even: true,
|
||||||
|
|
|
@ -0,0 +1,79 @@
|
||||||
|
{layout name="manager/layout" /}
|
||||||
|
<style>
|
||||||
|
.layui-table-cell{
|
||||||
|
height: auto;
|
||||||
|
white-space: normal;
|
||||||
|
}
|
||||||
|
.layui-table .layui-layer-photos {height: 90px;}
|
||||||
|
.layui-table img{
|
||||||
|
max-height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
display: block;
|
||||||
|
max-width: 150px;
|
||||||
|
vertical-align: middle;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<div class="layui-row layui-col-space12">
|
||||||
|
<div class="layui-col-xs12 layui-col-md12">
|
||||||
|
<div id="echarts-records" style="background-color:#ffffff;min-height:600px;">
|
||||||
|
<div class="layuimini-container location-index-page">
|
||||||
|
<div class="layuimini-main">
|
||||||
|
<fieldset class="table-search-fieldset" style="display: none">
|
||||||
|
<legend>搜索信息</legend>
|
||||||
|
<div style="margin: 10px 10px 10px 10px">
|
||||||
|
<form class="layui-form layui-form-pane" action="">
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label">关键词</label>
|
||||||
|
<div class="layui-inline">
|
||||||
|
<input type="text" name="keyword" class="layui-input">
|
||||||
|
</div>
|
||||||
|
<label class="layui-form-label">状态</label>
|
||||||
|
<div class="layui-inline">
|
||||||
|
<select name="state" id="">
|
||||||
|
<option value=""></option>
|
||||||
|
{foreach $state as $key=> $sitem }
|
||||||
|
<option value="{$key}">{$sitem}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="layui-inline">
|
||||||
|
<button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜 索</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
<div>
|
||||||
|
<table id="table-container" class="layui-table" data-url="/manager/consumer/index" lay-filter="table-container"></table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 操作列 -->
|
||||||
|
<script type="text/html" id="row-operate">
|
||||||
|
<a class="layui-btn layui-btn-primary layui-btn-xs" data-href="/manager/consumer/info.html?id={{d.id}}" data-title="消费者【{{ d.nick_name }}】详情" lay-event="">详情</a>
|
||||||
|
<!-- <a class="layui-btn layui-btn-primary layui-btn-xs" data-href="/manager/consumer/edit.html?id={{d.id}}" data-title="消费者【{{ d.nick_name }}】审核修改" lay-event="">审核修改</a>-->
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- toolbar -->
|
||||||
|
<script type="text/html" id="toolbar-tpl">
|
||||||
|
<a class="layui-btn layui-btn-primary layui-btn-sm" data-table-refresh lay-event="refresh"><i class="fa fa-refresh"></i></a>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- 列 轮播图 -->
|
||||||
|
<script type="text/html" id="row-cover">
|
||||||
|
<div class="layui-layer-photos">
|
||||||
|
<img src="{{ d.avatar_url }}" layer-src="{{ d.avatar_url }}" alt="">
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script src="__MANAGER__/js/consumer/index.js?v={:mt_rand()}"></script>
|
|
@ -61,7 +61,7 @@
|
||||||
<!-- 操作列 -->
|
<!-- 操作列 -->
|
||||||
<script type="text/html" id="row-operate">
|
<script type="text/html" id="row-operate">
|
||||||
<a class="layui-btn layui-btn-primary layui-btn-xs" data-href="/manager/consumer/info.html?id={{d.id}}" data-title="消费者【{{ d.nick_name }}】详情" lay-event="">详情</a>
|
<a class="layui-btn layui-btn-primary layui-btn-xs" data-href="/manager/consumer/info.html?id={{d.id}}" data-title="消费者【{{ d.nick_name }}】详情" lay-event="">详情</a>
|
||||||
<a class="layui-btn layui-btn-primary layui-btn-xs" data-href="/manager/consumer/edit.html?id={{d.id}}" data-title="消费者【{{ d.nick_name }}】审核修改" lay-event="">审核修改</a>
|
<!-- <a class="layui-btn layui-btn-primary layui-btn-xs" data-href="/manager/consumer/edit.html?id={{d.id}}" data-title="消费者【{{ d.nick_name }}】审核修改" lay-event="">审核修改</a>-->
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- toolbar -->
|
<!-- toolbar -->
|
||||||
|
|
Loading…
Reference in New Issue