Browse Source

公告列表增加orderBy('id', 'DESC')

dev
李可松 5 years ago
parent
commit
dc2e109b92
  1. 6
      app/Http/Controllers/Api/NoticeController.php

6
app/Http/Controllers/Api/NoticeController.php

@ -18,7 +18,11 @@ class NoticeController extends Controller
if ($page && !ctype_digit($page)) {
return $this->error('页码错误');
}
$list = Notice::where('agent_id', $this->agent_id)->select(['title', 'updated_at'])->simplePaginate(15);
$list = Notice::where('agent_id', $this->agent_id)
->select(['title', 'updated_at'])
->orderBy('id', 'DESC')
->simplePaginate(15);
return $this->success($list);
}

Loading…
Cancel
Save