信息平台的广告管理新增查询功能

webht/payment
Jimmy Liow 2 years ago
parent 6df816833b
commit eecb2a00e4

@ -58,19 +58,24 @@ class infoTips_model extends CI_Model
public function search($keywords) {
$keywordList = explode(" ", $keywords);
$whereCodition = '';
foreach ($keywordList as $keyword) {
$whereCodition .= ' and '.$keyword;
$whereCodition = ' and (';
foreach ($keywordList as $index => $keyword) {
if ($index > 0) {
$whereCodition .= " or ";
}
$whereCodition .= "it.it_title like '%" . $keyword . "%'";
}
foreach ($keywordList as $index => $keyword) {
$whereCodition .= " or it.it_content like '%" . $keyword . "%'";
}
$searchText =
"select it.it_id ,it.it_title,it.it_expires,it.it_code,it.it_content,it.it_sitecode,it.it_datetime
from infoTips it
where it.it_sitecode=?"
. $whereCodition
. "order by it_expires ASC";
// $query = $this->HT->query($searchText, array($this->config->item('site_code')));
echo $this->HT->query_string($searchText, array($this->config->item('site_code')));
// return $query->result();
. $whereCodition . ") "
. " order by it_expires ASC";
$query = $this->HT->query($searchText, array($this->config->item('site_code')));
return $query->result();
}
public function add($table, $data)

Loading…
Cancel
Save