From 897372b20897d12088b7d0efd4397b5a5faf1965 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Tue, 6 Jul 2010 02:17:38 +0000 Subject: [PATCH] * fix the error when the query is empty. --- trunk/module/search/model.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trunk/module/search/model.php b/trunk/module/search/model.php index 9a4d20c266..2aa5ac969f 100644 --- a/trunk/module/search/model.php +++ b/trunk/module/search/model.php @@ -140,11 +140,14 @@ class searchModel extends model { $sqlVar = $this->post->module . 'Query'; $formVar = $this->post->module . 'Form'; + $sql = $this->session->$sqlVar; + if(!$sql) $sql = ' 1 = 1 '; + $query = fixer::input('post') ->specialChars('title') ->add('account', $this->app->user->account) ->add('form', serialize($this->session->$formVar)) - ->add('sql', $this->session->$sqlVar) + ->add('sql', $sql) ->get(); $this->dao->insert(TABLE_USERQUERY)->data($query)->autoCheck()->check('title', 'notempty')->exec(); }