欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

在Join中使用FIND_IN_SET

程序员文章站 2022-05-07 09:18:58
$d['a.cold'] = 2; $d['b.PostId'] = $up_id['PostId']; $d['b.F_Id'] = $up_id['Id']; $d['WorkinTime'] = array('lt',$lastday); $down2 = Db::name('admin_us ......

在Join中使用FIND_IN_SET

 

 

$d['a.cold'] = 2;
$d['b.postid'] = $up_id['postid'];
$d['b.f_id'] = $up_id['id'];

$d['workintime'] = array('lt',$lastday);

$down2 = db::name('admin_user')
->field('a.*,a.id as user_id,b.*')
->alias('a')
// ->join('role b','a.roleid= b.id ')
->join('role b','find_in_set(b.id,a.roleid)')

->where($d)
->select();