# file: \shop\control\search.phpif ($_GET['keyword'] != '') {// 品牌搜索$model_brand = Model('brand');$condition_brand['brand_name'] = array('like', '%' . $_GET['keyword'] . '%');$row_brand = $model_brand-where($condition_brand)-find();
# 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'] . '%'); } }