<?php
namespace app\index\controller;
use think\Controller;
use app\index\controller\Common;

class Search extends Common
{
    public function index(){		
		$title   = urldecode(input('title'));
 		$where['title'] = array('like','%'.$title.'%');
		$where['mid'] = array('neq','6'); //不搜索广告栏目
		$order = "istop desc,sort desc,id desc";
		$list = db('article')->where($where)->order($order)->paginate(9,false,['query' => request()->param()]);		
		$data["list"] = $list;
		$data["page"] = $list->render();		
		$data["site"] = getseo();	
		$data["site"]['webtitle'] = '搜索-'.$data["site"]['webtitle'];
		$data["nid"] = 0;
		$data["columnName"] = '搜索';
		$this->assign($data);
		return $this->fetch('index@index/search');			
    }	
	
}
