//再拼接查询条件 if(isset($arrInput['extension'])){ if($arrInput['tags'] != '%'){ $conds = "tags like '%{$tags}%' and (title like '{$extension}' ". "or company like '{$extension}' ". "or designer like '{$extension}') "; }else{ $conds = "title like '{$extension}' or company like '{$extension}' ". "or designer like '{$extension}' "; } }else{ if($arrInput['tags'] != '%'){ $conds = "tags like '%{$tags}%' "; }else{ $conds = " 1=1 "; } }