function _search(){
var val = $(".banner-search__search").val();
if(!val){
layer.msg('不能为空');
return false;
}
location.href='/index.php?s=mall&c=search&m=show&keywords='+val;
}
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Dayrui Website Management System
*
* @sinceversion 2.0.0
* @authorDayrui
* @license http://www.dayrui.com/license
* @copyright Copyright (c) 2011 - 9999, Dayrui.Com, Inc.
* @filesourcesvn://www.dayrui.net/v2/news/controllers/search.php
*/
class Search extends M_Controller {
/**
* 构造函数
*/
public function __construct() {
parent::__construct();
}
/**
* 搜索
*/
public function index() {
parent::_search();
}
public function show() {
//获取搜索关键词
$keywords = $this->input->get('keywords');
//根据搜索关键词,获取城市/学校的所有childids
$linkage_id = $this->db->like('name', $keywords)->get('mt_linkage_data_3')->result_array();
$linkage_childids=$linkage_id[0]["childids"];
//如果搜索到结果
if(!empty($linkage_childids)){
$this->template->assign(array(
'linkage_childids' => $linkage_childids
));
$this->template->display('search.html');
//如果没有搜索到结果
}else{
$this->template->display('gather_info.html');
}
}
}
{list action=module module=mall IN_quyu=$linkage_childids }
{$t.title}{dr_cat_value($t.catid,'name')}
最低
{php $price = array();}
{php $group = $t.order_specification.option.group0;}
{loop $group $v}
{php $price[] = $t.order_specification.value[$v]['price'];}
{/loop}
${min($price)}起
每周
{/list}