Fix pagination of closet

This commit is contained in:
Pig Fang 2019-05-03 15:23:56 +08:00
parent c2906ecc4f
commit 51c9bac405
3 changed files with 3 additions and 2 deletions

View File

@ -50,13 +50,12 @@ class ClosetController extends Controller
$closet->offset(($page - 1) * $perPage)->limit($perPage);
// Pagination
$totalPages = ceil($closet->count() / $perPage);
$items = $closet->get()->map(function ($t) {
$t->name = $t->pivot->item_name;
return $t;
});
$totalPages = ceil($items->count() / $perPage);
return json('', 0, [
'category' => $category,

View File

@ -2,3 +2,4 @@
- Fixed possible error on update page.
- Fixed style of language menu.
- Fixed pagination of closet.

View File

@ -2,3 +2,4 @@
- 修复升级页面可能的出错
- 修复语言选择菜单的样式
- 修复衣柜的分页