1.TP6的whereNotExists采用闭包查询,
Db::table('channel_relate')->whereNotExists(function ($query) use($s_id,$ch_id){ $query->table('channel_relate')->where(['s_id'=>$s_id,'ch_id'=>$ch_id])->field('r_id');})->find()
其中如果有变量的话需要采用use否则会报错;
1.TP6的whereNotExists采用闭包查询,
Db::table('channel_relate')->whereNotExists(function ($query) use($s_id,$ch_id){ $query->table('channel_relate')->where(['s_id'=>$s_id,'ch_id'=>$ch_id])->field('r_id');})->find()
其中如果有变量的话需要采用use否则会报错;