模糊查询
公共函数搜索(){ $keyword = trim($_POST['$keyword']); $Model = M('admin'); $res= $map['用户名'] = array('like','%'.$keyword .'%'); if($res){ ????????? }别的{### ????????### }###}###
public function search(){ $keyword = trim(I('keyword ')); $map['username'] = array('like','%'.$keyword .'%');
$res=M('admin') ->where($map)- >select();
if($res){ $data['code']=1;
$data['data']=$res;
}else{ $data['code']=0;
$data['msg']='没有数据';
}
$this->ajaxreturn($data);
public function search(){ $keyword = trim(I('keyword ')); $map['username'] = array('like','%'.$keyword .'%');
$res=M('admin') ->where($map)- >select();
if($res){ $data['code']=1;
$data['data']=$res;
}else{ $data['code']=0;
$data['msg']='没有数据';
}
$this->ajaxreturn($data);
}