How to use thinkphp3.2 and ajax fuzzy query
zzz
zzz 2018-12-13 16:02:07
0
1
792
模糊查询

public function search()
{
   $keyword = trim($_POST['$keyword']);
   $Model = M('admin');
   $res=$map['username'] = array('like','%'.$keyword .'%');
   if($res){
        ?????????
   }else{
        ????????
   }
}

zzz
zzz

reply all(1)
加特米

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);

}

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template