<?php
class SearchAction extends HomeAction{
	public function chanpin(){
		$wd = trim($_GET['q']);
		$where = array();
		$where['chanpin_name'] = array('like',$wd.'%');
		$rs = D('Chanpin');
		$list = $rs->field('chanpin_name')->where($where)->limit(10)->order('chanpin_hits_month desc')->select();
		if($list){
			$this->ajaxReturn($list,"ok",1);
		}else{
			$this->ajaxReturn($list,"ok",0);
		}
	}
}
?>