fix: 分页转换int类型

This commit is contained in:
Ying
2022-11-28 22:34:17 +08:00
parent 3c98edcdd8
commit f19f236e9a
8 changed files with 8 additions and 8 deletions

View File

@@ -172,7 +172,7 @@ class AdminController extends BaseController
}
}
} catch (\ReflectionException $e) {}
$subQuery = $this->model->field('id')->where($where)->order($order, 'desc')->limit($limit)->page($page)->buildSql();
$subQuery = $this->model->field('id')->where($where)->order($order, 'desc')->limit((int)$limit)->page((int)$page)->buildSql();
$subQuery = '( SELECT object.id FROM ' . $subQuery . ' AS object )';
$list = $this->model->with($relation)->where('id in' . $subQuery)->order($order, 'desc')->select()->toArray();
foreach ($list as $key => $value) {