!46 对分页参数进行类型转换

Merge pull request !46 from 七彩枫叶/N/A
This commit is contained in:
meystack
2023-07-19 03:09:21 +00:00
committed by Gitee

View File

@@ -36,8 +36,8 @@ class AdminGroupService
*/ */
public static function dataList(array $params = []): array public static function dataList(array $params = []): array
{ {
$page = $params['page'] ?? 1; $page = (int)$params['page'] ?? 1;
$limit = $params['limit'] ?? 10; $limit = (int)$params['limit'] ?? 10;
$where = []; $where = [];
if (!empty($param['title'])) { if (!empty($param['title'])) {
$where[] = ['title', 'like', '%' . $param['title'] . '%']; $where[] = ['title', 'like', '%' . $param['title'] . '%'];