ShopNC 产品分类搜索功能

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

# file: \shop\control\search.php

if ($_GET['keyword'] != '') {
					// 品牌搜索
					$model_brand = Model('brand');
					$condition_brand['brand_name'] = array('like', '%' . $_GET['keyword'] . '%');
					$row_brand = $model_brand->where($condition_brand)->find();
					if ($row_brand) {
						$condition['goods_name|goods_jingle|brand_id'] = array(array('like', '%' . $_GET['keyword'] . '%'), array('eq', intval($row_brand['brand_id'])), 'or');
					} else {
						$condition['goods_name|goods_jingle'] = array('like', '%' . $_GET['keyword'] . '%');
					}
                }