Skip to content

Commit

Permalink
feat(*): 修改 APP 版本提示按照 ID 倒序,修复分页条件错误
Browse files Browse the repository at this point in the history
  • Loading branch information
medz committed Nov 28, 2018
1 parent 47c238b commit 98c9be6
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,15 @@ class ClientVersionController
*/
public function index(Request $request, ClientVersion $versionModel)
{
// $version_code = $request->query('version_code', 0);
$type = $request->query('type');
$limit = $request->query('limit', 15);
$after = $request->query('after');

$versions = $versionModel->when($after, function ($query) use ($after) {
return $query->where('id', '>', $after);
return $query->where('id', '<', $after);
})
->where('type', $type)
->orderBy('version_code', 'desc')
->orderBy('id', 'desc')
->limit($limit)
->get();

Expand Down

0 comments on commit 98c9be6

Please sign in to comment.