$res1 = ArticleAlpha::whereIn('status',['-1','-2'])->alias('a')->field('b.*') ->join('article_beta b','a.id = b.article_alpha_id and b.visible != -1') ->where('b.id',6)->find(); $res2 = \app\model\ArticleBeta::alias('b')->field('b.*') ->join('article_alpha a','b.article_alpha_id = a.id and b.visible != -1') ->select();