php mysql join find_in_set

select * from A
join B
on find_in_set(A.id,B.ids) != 0;

转载:https://blog.csdn.net/weixin_39454683/article/details/74989947

 

tp5.1 写法

				$banner_list = Db::name('banner')
				->alias('b')
				->field('b.id,b.title,b.img,b.url,b.description')
				->join('menu m','find_in_set(m.id,b.category)!=0')
				->where('m.deleted',0)
				->where('b.deleted',0)
				->where('m.hide_banner',0)
				->where('m.controller','Index')
				->select();

 

你可能感兴趣的:(php,thinkphp5)