$brandres = $db->select("select brand_id,brand_name from ecs_brand where $partamemter and is_show = 1 and brand_name like '%$keyword%'");
if(!empty($brandres)){
$brand_id = '';
foreach($brandres as $k => $v){
if($k){
$brand_id .= ",".$v->brand_id;
}else{
$brand_id .= $v->brand_id;
}
}
$brand_id = ltrim($brand_id,',');
$condition .= " or brand_id in($brand_id) ";
}