作者 刘朕
1 个管道 的构建 通过 耗费 1 秒

后台平台订单、用户列表优化

... ... @@ -27,11 +27,25 @@ class OrderscourierController extends AdminBaseController{
}
$data = Db::name('indent')->where($where)->where("state = 2 or state = 3 or state = 5")->order('create_time','DESC')->paginate(12);
$data->appends($param);
$list = $data->items();
foreach ($list as $k=>$v) {
$indent_goods = Db::name('indent_goods')->alias('ig')
->field('g.book_name,ig.number')
->join('__GOODS__ g','ig.goods_id = g.id')
->where('ig.indent_id',$v['id'])
->select()->toArray();
$goods = [];
foreach ($indent_goods as $kg=>$vg) {
$goods[] = $vg['book_name'].'X'.$vg['number'];
}
$list[$k]['books'] = implode(',',$goods);
}
$this->assign('start_time',!empty($param['start_time']) ? $param['start_time'] : '');
$this->assign('end_time',!empty($param['end_time']) ? $param['end_time'] : '');
$this->assign('keyword',!empty($param['keyword']) ? trim($param['keyword']) : '');
$this->assign('state',!empty($param['state']) ? $param['state'] : '');
$this->assign('data',$data);
$this->assign('data',$list);
$this->assign('page',$data->render());
return $this->fetch();
}
... ...
... ... @@ -16,7 +16,7 @@ class UsersController extends AdminBaseController{
];
if(!empty($param['keyword'])){
$keyword = trim($param['keyword']);
$where['b.user_nickname'] = ['like',"%$keyword%"];
$where['b.user_nickname|a.phone'] = ['like',"%$keyword%"];
}
if(!empty($param['id'])){
$where['a.id'] = ['eq',$param['id']];
... ...
... ... @@ -37,6 +37,8 @@
<tr>
<th>序号</th>
<th>订单号</th>
<th>姓名</th>
<th>书籍</th>
<th>数量</th>
<th>价钱</th>
<th>订单状态</th>
... ... @@ -49,6 +51,8 @@
<tr class="tr{$vo.id}">
<td>{$vo.id}</td>
<td>{$vo.order_number}</td>
<td>{$vo.name}</td>
<td>{$vo.books}</td>
<td>{$vo.book_num}</td>
<td>{$vo.money}</td>
<if condition="$vo.state eq 4">
... ... @@ -86,7 +90,7 @@
</tbody>
</table>
<div class="pagination">
{$data->render()}
{$page}
</div>
</div>
<script src="__STATIC__/js/admin.js"></script>
... ...
... ... @@ -24,7 +24,7 @@
value="{$id|default=''}" placeholder="请输入序号">
关键字:
<input type="text" class="form-control" name="keyword" style="width: 200px;"
value="{$keyword|default=''}" placeholder="请输入微信昵称...">
value="{$keyword|default=''}" placeholder="请输入微信昵称/手机号">
身份:
<select name="identity" class="form-control">
<option value="">全部</option>
... ...