l5:paginate
<?php
class SearchController{
public function getIndex(Request $request){
$account_type = $request->input('type');
$search = $request->input('search');
$tb_pam = (new PamAccount())->getTable();
$tb_ra = (new PamRoleAccount())->getTable();
$Db = \DB::table($tb_pam)->where('account_type', $account_type);
$Db->join($tb_ra, $tb_pam . '.account_id', '=', $tb_ra . '.account_id'); // role
if ($search['role_id']) {
$Db->where($tb_ra . '.role_id', $search['role_id']);
}
if ($search['account_name']) {
$Db->where($tb_pam . '.account_name', 'like', '%' . $search['account_name'] . '%');
}
if ($account_type == PamAccount::TYPE_DESKTOP) {
$tb_dsk = (new AccountDesktop())->getTable();
$Db->join($tb_dsk, $tb_pam . '.account_id', '=', $tb_dsk . '.account_id');
} elseif ($account_type == PamAccount::TYPE_DEVELOP) {
$tb_ft = (new AccountDevelop())->getTable();
$Db->join($tb_ft, $tb_pam . '.account_id', '=', $tb_ft . '.account_id');
} else {
$tb_ft = (new AccountFront())->getTable();
$Db->join($tb_ft, $tb_pam . '.account_id', '=', $tb_ft . '.account_id');
}
$accounts = $Db->paginate($this->pageNum);
$accounts->appends($request->input());
$roles = PamRole::getLinear($account_type);
return view('desktop.account.index', [
'accounts' => $accounts,
'account_type' => $account_type,
'search' => ['search' => $search],
'roles' => $roles,
]);
}
}
{!! Form::model(\Input::all(), ['method' => 'get', 'class'=> 'form-inline']) !!}
<div class="form-group">
{!! Form::label('cate_title','分类') !!}
{!! Form::text('cate_title', null, ['placeholder' => '请填写关键词', 'class'=> 'w120 form-control']) !!}
</div>
{!! Form::button('<i class="fa fa-search"> </i>', ['class'=> 'btn blue', 'type'=> 'submit']) !!}
{!! Html::link(route_url(), '清空条件', ['class'=> 'btn btn-warning']) !!}
{!!Form::close()!!}
@if ($items->total())
<table class="table table-bordered table-hover table-middle mt15">
<thead>
<tr>
<th>提现订单号</th>
<th>金额</th>
<th>手续费</th>
<th>实际到账</th>
<th>创建时间</th>
<th>状态</th>
<th>备注</th>
</tr>
</thead>
<tbody>
@foreach($items as $item)
<tr>
<td>{{$item['cash_no']}}</td>
<td>{{$item['amount']}}</td>
<td>{{$item['cash_fee']}}</td>
<td>{{$item['over_amount']}}</td>
<td class="center">{{$item['created_at']}}</td>
<td>{{\App\Lemon\Nucleus\Finance::cashStatusDesc($item->cash_status)}}</td>
<td class="center">
{!! $item->note !!}
</td>
</tr>
<tr>
<td colspan="7">
提现到: <span class="btn btn-default btn-xs">{{$item['bank_type']}}</span>
用户是: <span class="btn btn-default btn-xs">{{$item['bank_truename']}}</span>
账号是: <span class="btn btn-default btn-xs">{{$item['bank_account']}}</span>
</td>
</tr>
@endforeach
<tr>
<td>
<input type="checkbox" class="J_check_all" />
</td>
<td colspan="5">
<div class="pull-left">
<button class="btn btn-default J_submit red" data-confirm="确认删除选中的分类?" data-url="{{route('dsk_duobao_category.destroy')}}" data-ajax="true"><span>删除</span></button>
<button class="btn btn-info J_submit" data-url="{{route('dsk_duobao_category.batch_update')}}" data-ajax="true"><span>更新排序</span></button>
</div>
@if ($items->hasPages())
<div class="pull-right">
{!!$items->render()!!}
</div>
@endif
</td>
</tr>
</tbody>
</table>
@else
@include('desktop.inc.empty')
@endif