Using find in join_ IN_ SET

Time:2020-9-13

 

 

$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();