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

提现列表新增微信昵称搜索

... ... @@ -52,16 +52,17 @@ class WithdrawalController extends AdminBaseController{
$where['a.create_time'] = [['>=',$start_time],['<=',$end_time]];
}
if(!empty($param['keyword'])){
$where['b.phone'] = ['like','%'.trim($param['keyword']).'%'];
$where['b.phone|u.user_nickname'] = ['like','%'.trim($param['keyword']).'%'];
}
$data = Db::name('money_expend') -> alias('a') -> field('a.*,b.phone') -> join('my_user b','a.uid=b.uid','LEFT') -> where($where) -> order("a.create_time desc") -> paginate(12);
$data = Db::name('money_expend')
->alias('a')
->field('a.*,b.phone,u.user_nickname as name')
->join('my_user b','a.uid=b.uid','LEFT')
->join('user u','a.uid=u.id','LEFT')
->where($where)
->order("a.create_time desc")
->paginate(12);
$data_arr = $data -> toArray();
if(!empty($data_arr)){
foreach($data_arr['data'] as $key => $val){
$name = Db::name('user') -> where('id',$val['uid']) -> find();
$data_arr['data'][$key]['name'] = $name['user_nickname'];
}
}
$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']) : '');
... ...
... ... @@ -21,7 +21,7 @@
style="width: 140px;" autocomplete="off"> &nbsp;
关键字:
<input type="text" class="form-control" name="keyword" style="width: 200px;"
value="{$keyword|default=''}" placeholder="请输入手机号...">
value="{$keyword|default=''}" placeholder="请输入手机号/微信昵称">
<input type="submit" class="btn btn-primary" value="搜索"/>
<a class="btn btn-danger" href="{:url('Withdrawal/withd_list')}">清空</a>
</form>
... ...