Commit b3d76d62 by LiuJunYi

会员退款排序

parent ea53db5f
...@@ -345,7 +345,9 @@ class Order extends AuthBase ...@@ -345,7 +345,9 @@ class Order extends AuthBase
$query->where('phone', 'like', "%" . trim(input('phone')) . "%"); $query->where('phone', 'like', "%" . trim(input('phone')) . "%");
} }
$query->where('type', 2)->where('status', 1); $query->where('type', 2)->where('status', 1);
})->paginate(15, false, [ })
->order('id','desc')
->paginate(15, false, [
'query' => $_GET 'query' => $_GET
]); ]);
return $this->fetch('', compact('list')); return $this->fetch('', compact('list'));
......
{layout name="public/layout_main"}
<section class="wrapper">
<h3><i class="fa fa-angle-right"></i> 订单管理</h3>
<!-- 分割线 -->
<hr>
<div class="row margin-bottom">
<div class="col-md-12">
<form class="form-inline pull-left" method="GET"
action="">
<div class="form-group margin-right">
<input class="form-control" type="text" name="phone" value="{:input('phone')}" placeholder="用户手机号"/>
</div>
<div class="form-group margin-right">
<label for="">下单时间:</label>
<input class="form-control" type="date" name="start_time" id="start_time"
value="{:input('start_time')}" placeholder="起始"/>
--
<input class="form-control" type="date" name="end_time" id="end_time" value="{:input('end_time')}"
placeholder="结束"/>
</div>
<button type="submit" class="btn btn-primary">搜索</button>
</form>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>UID</th>
<th>订单名称</th>
<th>订单号</th>
<th>昵称</th>
<th>微信号</th>
<th>手机号</th>
<th>购买时间(年)</th>
<th>总价</th>
<th>会员到期时间</th>
<th>退款金额</th>
<th>下单时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{volist name="list" id="v" key="k" empty="暂时没有数据"}
<tr data-id="{$v->id}">
<td>{$v->id}</td>
<td>{$v->title}</td>
<td>{$v->out_trade_no}</td>
<td>
<img src="{$v['userinfo']['avatar']}" onerror="this.src='/static/img/default_avatar.png'" alt=""
style="width:40px;margin-right: 5px">{$v['userinfo']['nickname']}
</td>
<td>{$v['userinfo']['wx_number']}</td>
<td>{$v['userinfo']['phone']}</td>
<td>
{$v['extras']['year']}
</td>
<td>{$v->total_fee}</td>
<td>{$v['userinfo']['vip_endtime']}</td>
<td>
<input type="number" name="price" value="{$v->total_fee}" class="form-control"
style="width: 100px;">
</td>
<td>{$v->created_at}</td>
<td>
<button class="btn btn-primary refund">退款</button>
</td>
</tr>
{/volist}
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
{$list->render()}
</div>
</div>
</section>
<script src="/static/layer/layer.js"></script>
<script type="text/javascript">
// 文档加载完毕之后,会进入该方法
$(function () {
$('.refund').click(function(){
layer.load(2);
let id =$(this).closest('tr').attr('data-id')
let price =$(this).closest('tr').find('input').val()
let that =this
$.post("{:url('cardRefund')}",{id:id,price:price},function (res) {
layer.closeAll()
layer.msg(res.msg)
if(res.code===0){
$(that).closest('tr').remove();
}
});
});
});
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment