From 090d3476a6a733ecbb7c1cf17ca27fc964f0b274 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 9 Feb 2017 13:26:27 +0200 Subject: [PATCH] submit button check --- src/app/backend/controllers/CustomersController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/backend/controllers/CustomersController.php b/src/app/backend/controllers/CustomersController.php index 4df2485..2ee56a6 100644 --- a/src/app/backend/controllers/CustomersController.php +++ b/src/app/backend/controllers/CustomersController.php @@ -21,7 +21,7 @@ class CustomersController extends \Phalcon\Mvc\Controller $search_submit = $this->request->getPost('search_submit', 'string', NULL); $this->session->set('search_name', $search_name); $this->session->set('search_phone', $search_phone); - if (!empty($search_name) && isset($search_phone)) { + if (!empty($search_name) && (!empty($search_phone) || $search_phone == '0')) { $data = $this->models->getCustomers()->getDataByNameAndPhone($search_name, $search_phone); $total = 1; } @@ -29,7 +29,7 @@ class CustomersController extends \Phalcon\Mvc\Controller $data = $this->models->getCustomers()->getDataByName($search_name); $total = 1; } - elseif(isset($search_phone)) { + elseif(!empty($search_phone) || $search_phone == '0') { $data = $this->models->getCustomers()->getDataByPhone($search_phone); $total = 1; } -- libgit2 0.21.4