From cb64163ea03548fdc13664be428abc8ee9f5f5ae Mon Sep 17 00:00:00 2001 From: wangyidong Date: Thu, 24 Nov 2016 10:29:54 +0800 Subject: [PATCH] * finish task #2735. --- module/search/model.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/module/search/model.php b/module/search/model.php index dcc6d55ff3..87bd3019aa 100644 --- a/module/search/model.php +++ b/module/search/model.php @@ -110,7 +110,15 @@ class searchModel extends model } /* Set filed name. */ - if($condition) $where .= " $andOr " . '`' . $this->post->$fieldName . '` ' . $condition; + if($operator == '=' and preg_match('/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/', $value)) + { + $condition = '`' . $this->post->$fieldName . "` >= '$value' AND `" . $this->post->$fieldName . "` <= '$value 24:00:00'"; + $where .= " $andOr ($condition)"; + } + elseif($condition) + { + $where .= " $andOr " . '`' . $this->post->$fieldName . '` ' . $condition; + } } $where .=" ))";