thinkphp实现对两个字段或or条件搜索

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';  是条件或的实现



猜你喜欢

转载自blog.csdn.net/yeyinshi/article/details/50467768
今日推荐