diff --git a/app/adminapi/controller/user/UserController.php b/app/adminapi/controller/user/UserController.php index 3283922c..8eb88d1c 100644 --- a/app/adminapi/controller/user/UserController.php +++ b/app/adminapi/controller/user/UserController.php @@ -133,7 +133,16 @@ class UserController extends BaseAdminController //ๅˆ†้กต $pageNo = $this->request->get('page_no',1); $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')); } } \ No newline at end of file