$where[]='1=1';
if(!empty($arr['is_hot '])){
$a = $arr['is_hot'];
$where[]= 'is_hot ='."$a";
}
if(!empty($arr['is_show'])) {
$b = $arr['is_show'];
$where[] = 'is_show =' . "$b";
}
if(!empty($arr['t_id'])) {
$d = $arr['t_id'];
$where[] = 'sg_fruits.t_id ='."$d";
}
if(!empty($arr['f_name'])) {
$c = $arr['f_name'];
$where[] = 'f_name like \'%' . "$c".'%\'';
}
$wh=implode(' AND ',$where);