diff --git a/src/app/backend/controllers/CustomersController.php b/src/app/backend/controllers/CustomersController.php index 0884bff..b5824a1 100644 --- a/src/app/backend/controllers/CustomersController.php +++ b/src/app/backend/controllers/CustomersController.php @@ -16,9 +16,14 @@ class CustomersController extends \Phalcon\Mvc\Controller $params = $this->dispatcher->getParams(); $page = !empty( $params['page'] ) ? $params['page'] : 1; - $search = $this->request->getPost('search', 'string', NULL); - if (!empty($search)) { - $data = $this->models->getCustomers()->getDataByName($search); + $search_name = $this->request->getPost('search_name', 'string', NULL); + $search_phone = $this->request->getPost('search_phone', 'int', NULL); + if (!empty($search_name)) { + $data = $this->models->getCustomers()->getDataByName($search_name); + $total = 1; + } + elseif(!empty($search_phone)) { + $data = $this->models->getCustomers()->getDataByPhone($search_phone); $total = 1; } else { diff --git a/src/app/backend/views/customers/index.php b/src/app/backend/views/customers/index.php index 524965f..ae736f7 100644 --- a/src/app/backend/views/customers/index.php +++ b/src/app/backend/views/customers/index.php @@ -13,7 +13,8 @@