This commit is contained in:
chenbo 2024-02-22 13:54:05 +08:00
parent 6a87209f9c
commit c1b432d795
1 changed files with 10 additions and 1 deletions

View File

@ -133,7 +133,16 @@ class UserController extends BaseAdminController
//分页 //分页
$pageNo = $this->request->get('page_no',1); $pageNo = $this->request->get('page_no',1);
$pageSize = $this->request->get('page_size', 25); $pageSize = $this->request->get('page_size', 25);
$list = VillagerInformation::page($pageNo,$pageSize)->select()->toArray(); $query = VillagerInformation::page($pageNo,$pageSize);
$name = $this->request->get('name', '');
$contact = $this->request->get('contact', '');
if ($name) {
$query->where('name', 'like', '%' . $name . '%');
}
if ($contact) {
$query->where('contact', '=', $contact);
}
$list = $query->select()->toArray();
return $this->success('成功', compact('list')); return $this->success('成功', compact('list'));
} }
} }