<?php
/**
 * 搜索
 * @Copyright (C) 2017 汉潮 All rights reserved.
 * @License http://mendian.hanchao9999.com
 * @Author sunshine <1090855764@qq.com>
 */
namespace Mobile\Controller;
class PurSearchController extends BaseController {
    public function _initialize()
    {
        parent::_initialize();
        if (!checksiteauth('DingHuo,MenDian|GongHuoShang|CangKu')) {
            exit;
        }
    }
	public function index() {
		$search_history=session('pursearch_history');
		if(!empty($search_history)){
			$this->assign('history',$search_history);
		}
        $this->assign('tplseo_title','搜索历史'.'_'.C('WEB_SITE_TITLE'));
        $this->assign('page_title','搜索历史');
		$this->display();
	}
	public function clear_history() {
		session("pursearch_history",null);
		$data['status']=1;
		$data['data']="<h3>历史记录</h3><p><a><i class='iconfont'>&#xe6b4;</i>暂无搜索记录</a></p>";
		$this->ajaxReturn($data);
	}
}