thinkphp实现对两个字段或or条件搜索
$m=D('Adstext');$data['adstext_title']=array('like',"%{$keyword}%");$data['id']=array('like',"%{$keyword}%");$data['_logic'] = 'or'; //条件或$arr=$m->where($data)->relation(true)->select();
// dump($arr);
// exit;
Adstext是数据库表,$data['_logic'] = 'or'; 是条件或的实现
————————————————
原文链接:https://blog.csdn.net/yeyinshi/article/details/50467768