优化后台回收站列表逻辑

pull/236/head
Karson 2020-09-12 16:41:04 +08:00
parent 045b756272
commit f70e1f3349
1 changed files with 2 additions and 8 deletions

View File

@ -72,20 +72,14 @@ trait Backend
$this->request->filter(['strip_tags', 'trim']);
if ($this->request->isAjax()) {
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->onlyTrashed()
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->onlyTrashed()
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
->paginate($limit);
$result = array("total" => $total, "rows" => $list);
$result = array("total" => $list->total(), "rows" => $list->items());
return json($result);
}