修改用户管理充值明细列表
This commit is contained in:
parent
31f9e8693c
commit
039e85a293
@ -595,36 +595,35 @@ class UserLogic extends Logic
|
||||
|
||||
public static function getUserRecharge($get)
|
||||
{
|
||||
$model = new RechargeOrder();
|
||||
$model = new AccountLog();
|
||||
|
||||
$filter_where = [];
|
||||
|
||||
if (!empty($get['sel_type'])) {
|
||||
$filter_where[] = ['source_type', '=', $get['sel_type']];
|
||||
}
|
||||
|
||||
if (!empty($get['start_time']) && !empty($get['end_time'])) {
|
||||
$start_time = strtotime($get['start_time']);
|
||||
$end_time = strtotime($get['end_time']);
|
||||
$filter_where[] = ['pay_time', 'between', [$start_time, $end_time]];
|
||||
$filter_where[] = ['create_time', 'between', [$start_time, $end_time]];
|
||||
}
|
||||
|
||||
$user = User::where('id', $get['id'])->field('user_money')->find();
|
||||
|
||||
$where = [
|
||||
'user_id' => $get['id'],
|
||||
'pay_status' => PayEnum::ISPAID, // 已支付的
|
||||
];
|
||||
|
||||
$lists = $model::field('id, order_sn, pay_way, pay_time, order_amount')
|
||||
$lists = $model::field('id, log_sn, change_amount, left_amount, create_time')
|
||||
->where($filter_where)
|
||||
->where($where)
|
||||
->page($get['page'], $get['limit'])
|
||||
->order('pay_time desc')
|
||||
->order('create_time desc')
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
foreach ($lists as &$v) {
|
||||
$v['pay_time'] = date('Y-m-d H:i:s', $v['pay_time']);
|
||||
}
|
||||
|
||||
$count = $model::where($filter_where)->where($where)->count();
|
||||
|
||||
return [
|
||||
'count' => $count,
|
||||
'lists' => $lists,
|
||||
|
||||
@ -27,8 +27,9 @@
|
||||
<label for="recharge_type" class="layui-form-label">分类:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="recharge_type" id="recharge_type" lay-filter="recharge_type">
|
||||
<option value="0">增加余额</option>
|
||||
<option value="1">购买商品减少余额</option>
|
||||
<option value="">请选择分类</option>
|
||||
<option value="102">余额充值</option>
|
||||
<option value="103">购买商品减少余额</option>
|
||||
<option value="2">本地生活买单</option>
|
||||
<option value="3">本地生活购买商品</option>
|
||||
<option value="4">返补充值</option>
|
||||
@ -64,10 +65,16 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div style="margin-left: 20px; font-weight: bold">当前用户总余额: ¥{$info['user_money']}</div>
|
||||
|
||||
<table id="user-recharge" lay-filter="user-recharge"></table>
|
||||
|
||||
<script type="text/html" id="recharge_order_amount">
|
||||
¥ {{d.order_amount}}
|
||||
<script type="text/html" id="recharge_change_amount">
|
||||
¥ {{d.change_amount}}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="recharge_left_amount">
|
||||
¥ {{d.left_amount}}
|
||||
</script>
|
||||
</div>
|
||||
<!--成长值调整-->
|
||||
@ -225,11 +232,11 @@
|
||||
function getList(type) {
|
||||
if (type == 1) {
|
||||
like.tableLists('#user-recharge', '{:url("user.user/costDetails")}?id=' + id + '&type=' + type + '&sel_type=' + $('#recharge_type').val(), [
|
||||
{field: 'id', title: 'id', width: 60, align: 'center'}
|
||||
, {field: 'order_sn', title: '订单号', width: 200}
|
||||
, {field: 'pay_way', title: '支付方式', width: 200}
|
||||
, {field: 'pay_time', title: '支付时间', width: 200}
|
||||
, {field: 'order_amount', title: '支付金额', templet: '#recharge_order_amount', width: 200}
|
||||
{field: 'id', title: 'id', width: 100, align: 'center'}
|
||||
, {field: 'log_sn', title: '订单号', width: 200}
|
||||
, {field: 'change_amount', title: '变动金额', width: 200, templet: '#recharge_change_amount'}
|
||||
, {field: 'left_amount', title: '剩余金额', width: 200, templet: '#recharge_left_amount'}
|
||||
, {field: 'create_time', title: '创建时间', width: 200}
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user