发布网友 发布时间:2022-08-21 21:02
共1个回答
热心网友 时间:2023-09-12 20:31
$where=[];
if($keyword){
$where[]=["title","like","%$keyword%"];
}
$data = Db::name("xxx")->where($where)->select();
或者
$data = Db::name("xxx")->where('title','like',"%$keyword%")->select();